You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Jaroslaw Odzga (JIRA)" <ji...@apache.org> on 2009/06/02 11:49:07 UTC

[jira] Created: (HTTPCORE-198) CONNECT command is not sending Host header for HTTP 1.1

CONNECT command is not sending Host header for HTTP 1.1
-------------------------------------------------------

                 Key: HTTPCORE-198
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-198
             Project: HttpComponents HttpCore
          Issue Type: Bug
          Components: HttpCore
    Affects Versions: 4.0
            Reporter: Jaroslaw Odzga


HTTP 1.1 specifies that "Host" header is mandatory for all commands.
This header is being added in org.apache.http.protocol.RequestTargetHost. Unfortunately for CONNECT command the header is not added.
The CONNECT method is "special" command, so some of proxies don't expect "Host" header, but some do i.e. Clearswift Proxy returns:

Status Code: 400
HTTP Reason Phrase: Bad request
Description: The HTTP/1.1 request does not contain a Host header

I think RequestTargetHost should be modified so that for "CONNECT" command "Host" header is added as well. There would be no harm for Proxies that don't expect this header (it would be ignored) and library would work for few more Proxies.

It is enough to remove the following code from process method:

        String method = request.getRequestLine().getMethod();
        if (method.equalsIgnoreCase("CONNECT")) {
            return;
        }


-- 
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] Commented: (HTTPCORE-198) CONNECT command is not sending Host header for HTTP 1.1

Posted by "Jaroslaw Odzga (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCORE-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12716404#action_12716404 ] 

Jaroslaw Odzga commented on HTTPCORE-198:
-----------------------------------------

Works fine.

Cheers
Jarek

> CONNECT command is not sending Host header for HTTP 1.1
> -------------------------------------------------------
>
>                 Key: HTTPCORE-198
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-198
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>    Affects Versions: 4.0
>            Reporter: Jaroslaw Odzga
>             Fix For: 4.0.1
>
>
> HTTP 1.1 specifies that "Host" header is mandatory for all commands.
> This header is being added in org.apache.http.protocol.RequestTargetHost. Unfortunately for CONNECT command the header is not added.
> The CONNECT method is "special" command, so some of proxies don't expect "Host" header, but some do i.e. Clearswift Proxy returns:
> Status Code: 400
> HTTP Reason Phrase: Bad request
> Description: The HTTP/1.1 request does not contain a Host header
> I think RequestTargetHost should be modified so that for "CONNECT" command "Host" header is added as well. There would be no harm for Proxies that don't expect this header (it would be ignored) and library would work for few more Proxies.
> It is enough to remove the following code from process method:
>         String method = request.getRequestLine().getMethod();
>         if (method.equalsIgnoreCase("CONNECT")) {
>             return;
>         }

-- 
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: (HTTPCORE-198) CONNECT command is not sending Host header for HTTP 1.1

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

Oleg Kalnichevski resolved HTTPCORE-198.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 4.0.1

Fixed in trunk and 4.0.x branch. Please verify.

Oleg

> CONNECT command is not sending Host header for HTTP 1.1
> -------------------------------------------------------
>
>                 Key: HTTPCORE-198
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-198
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore
>    Affects Versions: 4.0
>            Reporter: Jaroslaw Odzga
>             Fix For: 4.0.1
>
>
> HTTP 1.1 specifies that "Host" header is mandatory for all commands.
> This header is being added in org.apache.http.protocol.RequestTargetHost. Unfortunately for CONNECT command the header is not added.
> The CONNECT method is "special" command, so some of proxies don't expect "Host" header, but some do i.e. Clearswift Proxy returns:
> Status Code: 400
> HTTP Reason Phrase: Bad request
> Description: The HTTP/1.1 request does not contain a Host header
> I think RequestTargetHost should be modified so that for "CONNECT" command "Host" header is added as well. There would be no harm for Proxies that don't expect this header (it would be ignored) and library would work for few more Proxies.
> It is enough to remove the following code from process method:
>         String method = request.getRequestLine().getMethod();
>         if (method.equalsIgnoreCase("CONNECT")) {
>             return;
>         }

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