jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1575303 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
Date Fri, 07 Mar 2014 16:00:37 GMT
Author: sebb
Date: Fri Mar  7 16:00:36 2014
New Revision: 1575303

URL: http://svn.apache.org/r1575303
Log:
Add some redirect processing debugging

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java?rev=1575303&r1=1575302&r2=1575303&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
Fri Mar  7 16:00:36 2014
@@ -1395,6 +1395,9 @@ public abstract class HTTPSamplerBase ex
         for (redirect = 0; redirect < MAX_REDIRECTS; redirect++) {
             boolean invalidRedirectUrl = false;
             String location = lastRes.getRedirectLocation(); 
+            if (log.isDebugEnabled()) {
+                log.debug("Initial location: " + location);
+            }
             if (REMOVESLASHDOTDOT) {
                 location = ConversionUtils.removeSlashDotDot(location);
             }
@@ -1402,13 +1405,20 @@ public abstract class HTTPSamplerBase ex
             // replacing them automatically with %20. We want to emulate
             // this behaviour.
             location = encodeSpaces(location);
+            if (log.isDebugEnabled()) {
+                log.debug("Location after /. and space transforms: " + location);
+            }
             // Change all but HEAD into GET (Bug 55450)
             String method = lastRes.getHTTPMethod();
             if (!HTTPConstants.HEAD.equalsIgnoreCase(method)) {
                 method = HTTPConstants.GET;
             }
             try {
-                lastRes = sample(ConversionUtils.makeRelativeURL(lastRes.getURL(), location),
method, true, frameDepth);
+                final URL url = ConversionUtils.makeRelativeURL(lastRes.getURL(), location);
+                if (log.isDebugEnabled()) {
+                    log.debug("Location as URL: " + url.toString());
+                }
+                lastRes = sample(url, method, true, frameDepth);
             } catch (MalformedURLException e) {
                 errorResult(e, lastRes);
                 // The redirect URL we got was not a valid URL



Mime
View raw message