hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jaroslaw Odzga (JIRA)" <j...@apache.org>
Subject [jira] Created: (HTTPCORE-198) CONNECT command is not sending Host header for HTTP 1.1
Date Tue, 02 Jun 2009 09:49:07 GMT
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")) {

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

View raw message