hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas Belisle (JIRA)" <j...@apache.org>
Subject [jira] Created: (HTTPCLIENT-939) 302 response without location header throws exception
Date Tue, 11 May 2010 14:47:41 GMT
302 response without location header throws exception
-----------------------------------------------------

                 Key: HTTPCLIENT-939
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-939
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient
    Affects Versions: 4.0.1
            Reporter: Nicolas Belisle


Hi, 

According to HTTP 1.1 Spec : http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3
"The temporary URI SHOULD be given by the Location field in the response. Unless the request
method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink
to the new URI(s)."

Now, in "DefaultRedirectStrategy.getLocationURI()", there's a ProtocolException thrown if
location header is null.  

if (locationHeader == null) {
    // got a redirect response, but no location header
    throw new ProtocolException(
        "Received redirect response " + response.getStatusLine()
       + " but no location header");
 }

The specs says "SHOULD" and not "MUST". ProtocolException "signals that an HTTP protocol violation
has occurred", which is not exactly true.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message