diff --git a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java b/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java index ef2985720f0..c7aacfbf84d 100644 --- a/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java +++ b/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java @@ -309,6 +309,8 @@ public static String[] getSourceTypeList() { private static final String RESPONSE_PARSERS = // list of parsers JMeterUtils.getProperty("HTTPResponse.parsers");//$NON-NLS-1$ + + private static final String LOCAL_FILE_PREFIX = "file:"; // $NON-NLS-1$ static { String[] parsers = JOrphanUtils.split(RESPONSE_PARSERS, " " , true);// returns empty array for null @@ -1363,12 +1365,13 @@ private LinkExtractorParser getParser(HTTPSampleResult res) * @return escaped url */ private String escapeIllegalURLCharacters(String url) { - if (url == null || url.toLowerCase().startsWith("file:")) { + if (url == null || url.regionMatches(true, 0, LOCAL_FILE_PREFIX, 0, LOCAL_FILE_PREFIX.length())) { return url; } + try { String escapedUrl = ConversionUtils.escapeIllegalURLCharacters(url); - if (!escapedUrl.equals(url) && log.isDebugEnabled()) { + if (log.isDebugEnabled() && !escapedUrl.equals(url)) { log.debug("Url '" + url + "' has been escaped to '" + escapedUrl + "'. Please correct your webpage."); }