You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/12/17 16:42:00 UTC

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

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16723142#comment-16723142 ] 

ASF subversion and git services commented on HTTPCLIENT-1956:
-------------------------------------------------------------

Commit 90f22e85ffa0bb8e457e2303582e4439c900b3af in httpcomponents-client's branch refs/heads/HTTPCLIENT-1956 from [~olegk]
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-client.git;h=90f22e8 ]

HTTPCLIENT-1956: CONNECT overwrites the main request object in the HTTP context when requests are executed via a proxy tunnel


> 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
>            Priority: Major
>         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