You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2020/08/13 10:50:41 UTC

[jmeter] branch master updated: Fix to: Implement a new setting to allow the exclusion of embedded URLs

This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 445df9f  Fix to: Implement a new setting to allow the exclusion of embedded URLs
445df9f is described below

commit 445df9f387d23cf5b8defa7c3d257608bff7904b
Author: Felix Schumacher <fe...@internetallee.de>
AuthorDate: Thu Aug 13 12:49:06 2020 +0200

    Fix to: Implement a new setting to allow the exclusion of embedded URLs
    
    A logic mistake would make the exclude filter be only applied, when
    a include filter was defined.
    
    Bugzilla Id: 63527
    Relates to #607
---
 .../java/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
index a897960..920be9e 100644
--- a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
+++ b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
@@ -1379,7 +1379,7 @@ public abstract class HTTPSamplerBase extends AbstractSampler
             if (excludeRegex.length() > 0) {
                 try {
                     excludePattern = JMeterUtils.getPattern(excludeRegex);
-                    if (localMatcher != null) {
+                    if (localMatcher == null) {
                         localMatcher = JMeterUtils.getMatcher();// don't fetch unless pattern compiles
                     }
                 } catch (MalformedCachePatternException e) { // NOSONAR
@@ -1422,6 +1422,7 @@ public abstract class HTTPSamplerBase extends AbstractSampler
                             setParentSampleSuccess(res, false);
                             continue;
                         }
+                        log.debug("allowPattern: {}, excludePattern: {}, localMatcher: {}, url: {}", allowPattern, excludePattern, localMatcher, url);
                         // I don't think localMatcher can be null here, but check just in case
                         if (allowPattern != null && localMatcher != null && !localMatcher.matches(url.toString(), allowPattern)) {
                             continue; // we have a pattern and the URL does not match, so skip it