You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2019/02/01 08:14:00 UTC
[jira] [Commented] (HTTPCLIENT-1968) Encoded forward slashes are
not preserved when rewriting URI
[ https://issues.apache.org/jira/browse/HTTPCLIENT-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16758075#comment-16758075 ]
Oleg Kalnichevski commented on HTTPCLIENT-1968:
-----------------------------------------------
[~reschke] So, we continue going merrily round in circles, round and round. And I keep on repeating the same things over and over:
# It is irrelevant what RFC 3986 states. {{java.net.URI}} conforms to the RFC 2396.
# There is no reference to RFC 3986 in RFC 2616.
# HttpClient needs to convert request URIs to {{abs_path}} representation when the user supplies a request URI in the absolute form. While doing so HttpClient need to deal with fringe cases like *{{https://host.com//p1/p2}}*. It is impossible to handle such paths consistently without normalization.
# Those fringe cases arise form people's insistence on being able to embed rubbish in the URI path component.
Oleg
> Encoded forward slashes are not preserved when rewriting URI
> ------------------------------------------------------------
>
> Key: HTTPCLIENT-1968
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1968
> Project: HttpComponents HttpClient
> Issue Type: Bug
> Affects Versions: 4.5.7
> Reporter: Jay Modi
> Priority: Major
> Attachments: rewrite_preserve_forward_slash.diff
>
>
> URIs that contain an encoded forward slash (%2F) are no longer preserved when the HTTP client executes. I came across this when upgrading from 4.5.2 to 4.5.7 and my requests that contained an encoded forward slash suddenly started failing. The appears to be due to decoding and re-encoding of the path that takes place in the URIUtils#rewriteURI method. I've attached a patch that restores the old behavior but if a URI contains two slashes in a row in addition to an encoded slash the encoded forward slash will be decoded.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org