-
Notifications
You must be signed in to change notification settings - Fork 594
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
Suprising (additional) percent escaping on Uri#authority rendering #1558
Comments
Regarding the general issue: we don't promise round trips for string representations. The minimum invariant we support is equivalence as described in RFC 3986 Section 6.1. I.e.
A stricter behavior could be to render fully normalized URIs. But even then, strings would only be the same if java would also promise to render normalized URIs and that both implementations actually implement the same logic. I haven't checked to which degree we render completely normalized URIs. For that reason, I think we should leave the behavior of java.net.URI out of the picture for now. |
For me it looks as if our parser wouldn't properly percent decode the user info before passing it into the model as it is doing everywhere else. |
I.e. for me the bug is this: scala> Uri("http://test:p%40ssword@example.com").authority.userinfo
res3: String = test:p%40ssword while the result should be |
If you compare the parser logic e.g. to its processing of a host name it seems the percent decoding was just forgotten. Compare akka-http/akka-http-core/src/main/scala/akka/http/impl/model/parser/UriParser.scala Line 170 in f9e8783
with akka-http/akka-http-core/src/main/scala/akka/http/impl/model/parser/UriParser.scala Line 143 in f9e8783
|
Should be simple enough to fix by using |
Apart from that RFC 3986 Section 3.2.1 states this:
So, we could even go as far as dropping or ignoring userinfo completely. |
Percent decode userinfo while parsing URIs (#1558)
It was reported that:
The issue seems to be not in parsing but rendering, I'll submit a proposal but not 100% sure if it's the best way to address this.
The text was updated successfully, but these errors were encountered: