Commit 050aab0
committed
Work Around HtmlUnitRequestBuilder setting ServletRequest.serverPort = -1
See the following issues:
- spring-projects/spring-framework#35709
- spring-projects/spring-boot#47857
Without this workaround we get the following error:
```
org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter$OAuth2AuthorizationRequestException: Bad authority
at org.springframework.security.oauth2.client.web.OAuth2AuthorizationRequestRedirectFilter.doFilterInternal(OAuth2AuthorizationRequestRedirectFilter.java:190) ~[spring-security-oauth2-client-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
Caused by: org.springframework.web.util.InvalidUrlException: Bad authority
at org.springframework.web.util.RfcUriParser.fail(RfcUriParser.java:65) ~[spring-web-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
at org.springframework.web.util.RfcUriParser.verify(RfcUriParser.java:53) ~[spring-web-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
at org.springframework.web.util.RfcUriParser$InternalParser.captureHost(RfcUriParser.java:530) ~[spring-web-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
at org.springframework.web.util.RfcUriParser$State$4.handleNext(RfcUriParser.java:199) ~[spring-web-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
at org.springframework.web.util.RfcUriParser$InternalParser.parse(RfcUriParser.java:465) ~[spring-web-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
at org.springframework.web.util.RfcUriParser.parse(RfcUriParser.java:47) ~[spring-web-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
at org.springframework.web.util.UriComponentsBuilder.fromUriString(UriComponentsBuilder.java:208) ~[spring-web-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
at org.springframework.web.util.UriComponentsBuilder.fromUriString(UriComponentsBuilder.java:180) ~[spring-web-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
at org.springframework.security.oauth2.client.web.DefaultOAuth2AuthorizationRequestResolver.expandRedirectUri(DefaultOAuth2AuthorizationRequestResolver.java:244) ~[spring-security-oauth2-client-7.0.0-SNAPSHOT.jar:7.0.0-SNAPSHOT]
... 160 common frames omitted
```1 parent 0f34f22 commit 050aab0
File tree
1 file changed
+11
-0
lines changed- servlet/spring-boot/java/oauth2/login/src/integTest/java/example
1 file changed
+11
-0
lines changedLines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
347 | 350 | | |
348 | 351 | | |
349 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
350 | 361 | | |
351 | 362 | | |
352 | 363 | | |
| |||
0 commit comments