Skip to content

Commit

Permalink
Fix issue where 'all' scope requires matches in both html parts
Browse files Browse the repository at this point in the history
  • Loading branch information
rykkard committed Aug 19, 2020
1 parent bdb3321 commit 2b16e12
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions v2/pkg/matchers/match.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ func (m *Matcher) Match(resp *http.Response, body, headers string) bool {
} else if m.part == HeaderPart {
return m.matchWords(headers)
} else {
if !m.matchWords(headers) {
return false
}
return m.matchWords(body)
return m.matchWords(headers) || m.matchWords(body)
}
case RegexMatcher:
// Match the parts as required for regex check
Expand All @@ -34,10 +31,7 @@ func (m *Matcher) Match(resp *http.Response, body, headers string) bool {
} else if m.part == HeaderPart {
return m.matchRegex(headers)
} else {
if m.matchRegex(headers) {
return true
}
return m.matchRegex(body)
return m.matchRegex(headers) || m.matchRegex(body)
}
case BinaryMatcher:
// Match the parts as required for binary characters check
Expand All @@ -46,10 +40,7 @@ func (m *Matcher) Match(resp *http.Response, body, headers string) bool {
} else if m.part == HeaderPart {
return m.matchBinary(headers)
} else {
if !m.matchBinary(headers) {
return false
}
return m.matchBinary(body)
return m.matchBinary(headers) || m.matchBinary(body)
}
case DSLMatcher:
// Match complex query
Expand Down

0 comments on commit 2b16e12

Please sign in to comment.