[
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: [email protected]
For additional commands, e-mail: [email protected]