You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Nicolas Belisle (JIRA)" <ji...@apache.org> on 2010/05/11 16:47:41 UTC

[jira] Created: (HTTPCLIENT-939) 302 response without location header throws exception

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


[jira] Resolved: (HTTPCLIENT-939) 302 response without location header throws exception

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski resolved HTTPCLIENT-939.
------------------------------------------

    Fix Version/s: 4.1 Alpha2
       Resolution: Fixed

Fixed in SVN trunk. Please review

Oleg

> 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
>             Fix For: 4.1 Alpha2
>
>
> 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