You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2018/12/23 10:18:41 UTC

svn commit: r1849596 - in /jmeter/trunk: src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java xdocs/changes.xml

Author: pmouawad
Date: Sun Dec 23 10:18:40 2018
New Revision: 1849596

URL: http://svn.apache.org/viewvc?rev=1849596&view=rev
Log:
Bug 62852 - HTTP Request Header missing information when using a proxy

Patch by Felix Schumacher
Bugzilla Id: 62852

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java?rev=1849596&r1=1849595&r2=1849596&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java Sun Dec 23 10:18:40 2018
@@ -384,6 +384,18 @@ public class HTTPHC4Impl extends HTTPHCA
     private static final HttpRequestExecutor REQUEST_EXECUTOR = new HttpRequestExecutor() {
 
         @Override
+        public void preProcess(HttpRequest request, org.apache.http.protocol.HttpProcessor processor, HttpContext context) throws HttpException ,IOException {
+            Object savedRequest = context.getAttribute(HttpCoreContext.HTTP_REQUEST);
+            super.preProcess(request, processor, context);
+            // Temporary fix to https://issues.apache.org/jira/browse/HTTPCLIENT-1956
+            // TODO Remove it when httpclient-4.5.7 is released
+            if (HTTPConstants.CONNECT.equals(request.getRequestLine().getMethod())) {
+                log.debug("Swap in original http request: {} for {}", savedRequest, request);
+                context.setAttribute(HttpCoreContext.HTTP_REQUEST, savedRequest);
+            }
+        }
+
+        @Override
         protected HttpResponse doSendRequest(
                 final HttpRequest request,
                 final HttpClientConnection conn,

Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1849596&r1=1849595&r2=1849596&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml [utf-8] (original)
+++ jmeter/trunk/xdocs/changes.xml [utf-8] Sun Dec 23 10:18:40 2018
@@ -156,6 +156,7 @@ of previous time slot as a base. Startin
     <li><bug>62916</bug>HTTP Test Script Recorder fails with UnsupportedOperationException if recording is started after a distributed test has been run</li>
     <li><bug>62987</bug>A TestBean element under HTTP(S) Test Script recorder does not work. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
     <li><bug>62987</bug>Abnormal NoHttpResponseException when running request through proxy HTTP(S) Test Script Recorder after a first failing request. Contributed by Ubik Load Pack (support at ubikloadpack.com)</li>
+    <li><bug>62852</bug>HTTP Request Header missing information when using a proxy</li>
 </ul>
 
 <h3>Other Samplers</h3>