hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32393] New: - Too much encoding with manual redirects
Date Thu, 25 Nov 2004 16:44:27 GMT
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

           Summary: Too much encoding with manual redirects
           Product: HttpClient
           Version: 3.0 Beta 1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Commons HttpClient
        AssignedTo: httpclient-dev@jakarta.apache.org
        ReportedBy: ghexsel@uol.com.br


I'm doing a manual redirect (mainly for performance and timeout-control issues)
and I have run into a header that is incorrectly getting encoded. 
Unfortunately, the website IP authenticated.  I'll try to provide as much
information as possible.

This is the code I'm using to generate the redirects (slightly simplified, only
the redirections):
-----
params: HttpURL previousAddress, String urlString

HttpURL url;
if (previousAddress == null) {
    url = new HttpURL(urlString);
} else {
    url = new HttpURL(previousAddress, urlString);
}
configureHttpMethod(method, url, timeoutChecker.getRemainingTime());
logState(state);

HostConfiguration hostConfig = new HostConfiguration();
hostConfig.setHost(url);
int statusCode = client.executeMethod(hostConfig, method, state);

if (isRedirect(statusCode)) {
    Header locationHeader = method.getResponseHeader("location");
    String locationString = locationHeader.getValue();
    *** recurse with urlString = locationString and the current page URL as
previousAddress
    
} else ...

------

   The problem is that the location URL is being returned in the header as:
http://weblinks1.epnet.com/resultlist.asp?tb=1&_ug=sid+8B8E0347%252D833B%252D47A8%252D9636%252D8767E91E1564%2540sessionmgr2+dbs+ufh+9ECB&_us=ri+KAAACBZD00035728+sm+ES+4E1A&_uso=st%255B0+%252Dtree+tg%255B0+%252D+db%255B0+%252Dufh+op%255B0+%252D+hd+False+F7B2&lfr=Persistent+Link

   but when I use the browser and check the headers I'm getting redirected to, I
get:
http://weblinks2.epnet.com/resultlist.asp?tb=1&_ug=sid+6627952A%2D23A5%2D4085%2DBBAC%2DFB9DD731CDAC%40sessionmgr2+dbs+ufh+0DD2&_us=ri+KAAACB1D00114674+sm+ES+0EFA&_uso=st%5B0+%2Dtree+tg%5B0+%2D+db%5B0+%2Dufh+op%5B0+%2D+hd+False+F7B2&lfr=Persistent+Link

  Apart from the server name and session number, the only difference is that '%'
signs are being URL-encoded, which is not what that website intended, as those
are already encoded.

  Is there a way to prevent headers from being encoded?  Or should I decode all
headers before?  The examples don't encode at all.

-- 
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


Mime
View raw message