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