[ https://issues.apache.org/jira/browse/HTTPCLIENT-1968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16757665#comment-16757665 ]
Julian Reschke commented on HTTPCLIENT-1968: -------------------------------------------- RFC 2616 and RFC 7230 define scheme-specific normalization of HTTP URIs. If you start with a relative reference, you'll have to resolve it against an HTTP base URI to get a full URI (as per https://www.greenbytes.de/tech/webdav/rfc3986.html#reference-resolution). The result could then be compared against another HTTP URI. Looking at <https://www.greenbytes.de/tech/webdav/rfc3986.html#relative-ref>, the only way "//p1/p2" can be interpreted is the first alternative: relative-part = "//" authority path-abempty so it would parse as authority "p1" and path "/p2". What other relative reference do you want to compare it with? (I'm really interested in finding out whether the specs are broken, or there's a misunderstanding here) > 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-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org