-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.x: HttpClient first URI segment is omitted if path starts with // #7474
Comments
We also need to support (from conversation with @romain-grecourt, and other expected cases):
This is only for the initial leading |
@romain-grecourt @tomas-langer This is actually a server issue eg.: To avoid client yielding WebClient.builder().baseUri("http://localhost:8080//foo/bar").build()
.get().uri().path() |
Feels like a bug in the |
Huh not really a JDK bug, TIL about absoluteURI = scheme ":" ( hier_part | opaque_part )
hier_part = ( net_path | abs_path ) [ "?" query ]
net_path = "//" authority [ abs_path ]
abs_path = "/" path_segments
opaque_part = uric_no_slash *uric
uric_no_slash = unreserved | escaped | ";" | "?" | ":" | "@" |"&" | "=" | "+" | "$" | "," |
Environment Details
When the path of a URI starts with
//
the first segment is omitted.E.g.
http://localhost:8080//foo/bar
will make a request to/bar
!This is awkward as it is common to have a trailing slash in a URI (E.g.
http://localhost:8080/
), resolving that URI without normalizing can lead to a path that starts with a double slash.E.g.
Reproducer:
Note that I ran into this while writing a unit test that retrieved the URI for given socket:
The text was updated successfully, but these errors were encountered: