-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: correct matcher-status regression for multiple failed requests #6382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| id: matcher-status-multiple-failures | ||
|
|
||
| info: | ||
| name: Test Matcher Status Multiple Failures | ||
| author: pdteam | ||
| severity: info | ||
|
|
||
| http: | ||
| - method: GET | ||
| path: | ||
| - "{{BaseURL}}/" | ||
| - "{{BaseURL}}/test" | ||
| - "{{BaseURL}}/admin" | ||
|
|
||
| matchers: | ||
| - type: word | ||
| words: | ||
| - "THIS_STRING_WILL_NEVER_MATCH" | ||
| part: body |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -182,8 +182,10 @@ func (e *TemplateExecuter) Execute(ctx *scan.ScanContext) (bool, error) { | |
| // non-`global-matchers` templates can enter the `writeFailureCallback` | ||
| // func to log failure output. | ||
| wr := writer.WriteResult(event, e.options.Output, e.options.Progress, e.options.IssuesClient) | ||
| if wr && !isGlobalMatchers { | ||
| matched.Store(true) | ||
| if wr { | ||
| if !isGlobalMatchers { | ||
| matched.Store(true) | ||
| } | ||
|
Comment on lines
-185
to
+188
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aren’t both of them (this & cc5c550) logically equivalent and producing the same result?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I misidentified the root cause.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no worries. |
||
| } else { | ||
| lastMatcherEvent = event | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.