You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by se...@apache.org on 2013/10/03 19:03:39 UTC
svn commit: r1528939 -
/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
Author: sebb
Date: Thu Oct 3 17:03:38 2013
New Revision: 1528939
URL: http://svn.apache.org/r1528939
Log:
Improve logging
Modified:
jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java
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=1528939&r1=1528938&r2=1528939&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 Thu Oct 3 17:03:38 2013
@@ -330,12 +330,15 @@ public class HTTPHC4Impl extends HTTPHCA
if (res.isRedirect()) {
final Header headerLocation = httpResponse.getLastHeader(HTTPConstants.HEADER_LOCATION);
if (headerLocation == null) { // HTTP protocol violation, but avoids NPE
- throw new IllegalArgumentException("Missing location header");
+ throw new IllegalArgumentException("Missing location header in redirect for " + httpRequest.getRequestLine());
}
+ final String redirectLocation = headerLocation.getValue();
try {
- res.setRedirectLocation(ConversionUtils.sanitizeUrl(new URL(headerLocation.getValue())).toString());
+ final URL redirectUrl = new URL(redirectLocation);
+ res.setRedirectLocation(ConversionUtils.sanitizeUrl(redirectUrl).toString());
} catch (Exception e) {
- log.error("Error sanitizing URL:"+headerLocation.getValue()+", message:"+e.getMessage());
+ log.error("Error in redirect URL for " + httpRequest.getRequestLine());
+ log.error("Error sanitizing redirect URL: " + redirectLocation + "\n\t", e);
}
}