jira-importer opened a new issue, #1329:
URL: https://github.com/apache/httpcomponents-core/issues/1329

   **[Jaroslaw 
Odzga](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jarek)** 
opened 
**[HTTPCORE-198](https://issues.apache.org/jira/browse/HTTPCORE-198?redirect=false)**
 and commented
   
   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;
       }
   
   
   
   ---
   
   **Affects:** 4.0
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to