You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by bu...@apache.org on 2004/11/25 18:21:41 UTC

DO NOT REPLY [Bug 32393] - Flawed encoding with HttpURL

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32393>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32393


ghexsel@uol.com.br changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Too much encoding with      |Flawed encoding with HttpURL
                   |manual redirects            |




------- Additional Comments From ghexsel@uol.com.br  2004-11-25 18:21 -------
Ok, I think I got the point where things are going wrong.  It's the HttpURL
behaviour that is not quite as expected.  I use the HttpURL(HttpURL base, String
relative) constructor to find the complete address for the next redirection. 
But the encoding seems flawed:

Base HttpURL.toString()     =
http://weblinks2.epnet.com/resultlist.asp?tb=1&_ug=sid%20CE67E964-4F40-4EFE-B856-1B36C8DB6DED@sessionmgr2%20dbs%20ufh%20AB6A&_us=ri%20KAAACB1D00140089%20sm%20ES%20C16E&_uso=st%5B0%20-tree%20tg%5B0%20-%20db%5B0%20-ufh%20op%5B0%20-%20hd%20False%20F7B2&lfr=Persistent%20Link
Relative URL String         =
citation.asp?tb=1&amp;_ug=sid+CE67E964%2D4F40%2D4EFE%2DB856%2D1B36C8DB6DED%40sessionmgr2+dbs+ufh+AB6A&amp;_us=dstb+ES+ri+KAAACB1D00140089+sm+ES+sl+%2D1+or+Date+A5ED&amp;_uso=st%5B0+%2Dtree+tg%5B0+%2D+db%5B0+%2Dufh+op%5B0+%2D+hd+False+F7B2&amp;fn=1&amp;rn=35

url.getURI()                =
http://weblinks2.epnet.com/citation.asp?tb=1&amp;_ug=sid
CE67E964%2D4F40%2D4EFE%2DB856%2D1B36C8DB6DED%40sessionmgr2 dbs ufh
AB6A&amp;_us=dstb ES ri KAAACB1D00140089 sm ES sl %2D1 or Date
A5ED&amp;_uso=st%5B0 %2Dtree tg%5B0 %2D db%5B0 %2Dufh op%5B0 %2D hd False
F7B2&amp;fn=1&amp;rn=35
new String(url.getRawURI()) =
http://weblinks2.epnet.com/citation.asp?tb=1&amp;_ug=sid+CE67E964%252D4F40%252D4EFE%252DB856%252D1B36C8DB6DED%2540sessionmgr2+dbs+ufh+AB6A&amp;_us=dstb+ES+ri+KAAACB1D00140089+sm+ES+sl+%252D1+or+Date+A5ED&amp;_uso=st%255B0+%252Dtree+tg%255B0+%252D+db%255B0+%252Dufh+op%255B0+%252D+hd+False+F7B2&amp;fn=1&amp;rn=35
url.getEscapedURI()         =
http://weblinks2.epnet.com/citation.asp?tb=1&amp;_ug=sid+CE67E964%252D4F40%252D4EFE%252DB856%252D1B36C8DB6DED%2540sessionmgr2+dbs+ufh+AB6A&amp;_us=dstb+ES+ri+KAAACB1D00140089+sm+ES+sl+%252D1+or+Date+A5ED&amp;_uso=st%255B0+%252Dtree+tg%255B0+%252D+db%255B0+%252Dufh+op%255B0+%252D+hd+False+F7B2&amp;fn=1&amp;rn=35

This is an example of what I collected by copy/paster from the HTML source.  The
relative part of the URL should follow this model.  It's exactly what I'm
setting in the relative URL.
Expected Relative           =
citation.asp?tb=1&amp;_ug=sid+46290CF8%2DEA37%2D4EBA%2DA980%2DC2A1455A366F%40sessionmgr2+dbs+ufh+4683&amp;_us=dstb+ES+ri+KAAACBZD00012607+sm+ES+sl+%2D1+or+Date+4B6E&amp;_uso=st%5B0+%2Dtree+tg%5B0+%2D+db%5B0+%2Dufh+op%5B0+%2D+hd+False+F7B2&amp;fn=1&amp;rn=1

As you can see, the methods in HttpURL are doing either too much encoding (by
encoding '%' without any explicit order) or too much decoding (by decoding '+').

I'll look into the code and I'll send a fix if I can solve the issue.



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org