-
Notifications
You must be signed in to change notification settings - Fork 183
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
[BUG] Default URL path encoding differs between main
& 2.x
#1103
Comments
main
& 2.x
This is due to |
Understood. One of the other various tickets asked for a unit test. Contribution requested a ticket (default in the unknown). Thanks for working it. If I can help let me know. Not sure why you are supporting 2 httpClient versions, but if you want some help supporting only 1 I am happy to lend a hand. I just need some rather direct do this and then do that. |
So I've narrowed the difference down to the fact v5 is more conservative and encodes everything not in the I think this is a fairly strong argument to bring in a version of v5's PercentCodec class and remove the need for reflection and have consistent behaviour. It would also reduce dependency if we had a future transport implementation that's completely independent of Apache HttpClient. I know something like this was the original approach in #999, however there were some reservations which led to the reflection approach. |
I am in full support of a consistent approach @Xtansia. I would potentially preserve the option of using one or the other library for backwards compatibility, hopefully without reflection as a configuration option. |
Why dance around it with far away imports of PercentCodec and just update PathEcoder to use the core5 URIEncoder (replacement for the utils class currently used for backward compatibility-ish)? |
@al-niessner 2.x does not take a hard dependency on v5, it by default depends on v4, so v5 is not always available. Additionally |
@reta The only thing we could break by being more conservative is anything that is sniffing the HTTP request in flight and doing matching without decoding the URL path. In the RFC the colon specifically is only safe to be not encoded when there's a schema present in a URI. I'm unsure how this goes once we get to HTTP message level etc. But this obviously causes weird interactions with things such as the load balancers etc in AOSS (as seen in #1068) which I can only guess makes different assumptions. I can also imagine this may not be limited to AOSS but also other managed providers, load balancers, HTTP proxies etc. If we do want to be ultra safe, we can do as @dblock and create an (I guess technically removing the |
Thanks @Xtansia
+1 to keep it safe as @dblock suggested
I think we could repurpose it to rely on |
In all other cases we could attach the |
After thinking/digging a bit further, the instance based approach in my previous comment does not work for |
A fix/feature to support this has been released as part of v2.13.0. For safety/backwards-compatibility reasons we couldn't change the default behavior in |
What is the bug?
See unit test updates. They work on main but not 2.x.
How can one reproduce the bug?
Run EndpointTest on main (passes) and then 2.x (fails)
What is the expected behavior?
Should behave the same if all code changes were moved to 2.x
What is your host/environment?
Eclipse on Linux
Do you have any screenshots?
No but can provide if critical
Do you have any additional context?
Updated unit tests on the way. Related to #1068 and #999 and #1012 and possibly others.
The text was updated successfully, but these errors were encountered: