You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Philippe Mouawad (JIRA)" <ji...@apache.org> on 2018/12/15 21:18:00 UTC

[jira] [Created] (HTTPCLIENT-1956) Using a Proxy with HttpClient overwrite attributes stored under HttpContext for the main request (not proxy one)

Philippe Mouawad created HTTPCLIENT-1956:
--------------------------------------------

             Summary: Using a Proxy with HttpClient overwrite attributes stored under HttpContext for the main request (not proxy one)
                 Key: HTTPCLIENT-1956
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1956
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient (classic)
    Affects Versions: 4.5.6
            Reporter: Philippe Mouawad
         Attachments: ProxyBug.java

At JMeter, we had this bug report on JMeter 5.0 which uses last GA version of HTTPCORE- 4.4.10/HTTPCLIENT-4.5.6:
 * [https://bz.apache.org/bugzilla/show_bug.cgi?id=62852]
 * 
The problem is that below method behaves differently if request is emitted directly or through a Proxy:
 * localContext.getAttribute(HttpCoreContext.HTTP_REQUEST);
If you run code below and inspect:
 * localContext.getAttribute(HttpCoreContext.HTTP_REQUEST);

While you  should get this (and you indeed get this if you don't use a proxy):
 * The GET method
 * All headers:
 * X-Sleep:5

 * Host: [jmeter.apache.org:443|http://jmeter.apache.org:443/],
 * User-Agent: Apache-HttpClient/4.5.6 (Java/1.8.0_161)
Instead you get:
 * CONNECT method (the proxy related one)
 * Partial Headers:

 * Host: [jmeter.apache.org:443|http://jmeter.apache.org:443/],
 * User-Agent: Apache-HttpClient/4.5.6 (Java/1.8.0_161)
In test case below:
 * [http://localhost:8888|http://localhost:8888/] act as proxy (you can use JMeter HTTP Test Script recorder to start a proxy or any proxy implementation running on that port)
 * [https://jmeter.apache.org|https://jmeter.apache.org/] is the target website, but you can use any site you want
 * X-Sleep is the custom header that is lost for example
 

Find attached JUnit reproducing issue.

The impact can be wider



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org