Skip to content

Commit

Permalink
Merge pull request #132 from projectdiscovery/dsl-fix
Browse files Browse the repository at this point in the history
DSL Fix
  • Loading branch information
Mzack9999 authored Jul 6, 2020
2 parents 3e07576 + 678f543 commit 606c46b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:

- name: Test
run: go test .
working-directory: cmd/nuclei/
working-directory: v2/cmd/nuclei/

- name: Build
run: go build .
working-directory: cmd/nuclei/
working-directory: v2/cmd/nuclei/
13 changes: 2 additions & 11 deletions v2/pkg/executor/executer_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (

"github.com/pkg/errors"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/nuclei/v2/pkg/extractors"
"github.com/projectdiscovery/nuclei/v2/pkg/matchers"
"github.com/projectdiscovery/nuclei/v2/pkg/requests"
"github.com/projectdiscovery/nuclei/v2/pkg/templates"
Expand Down Expand Up @@ -156,12 +155,7 @@ mainLoop:
var headers string
matcherCondition := e.httpRequest.GetMatchersCondition()
for _, matcher := range e.httpRequest.Matchers {
// Only build the headers string if the matcher asks for it
part := matcher.GetPart()
if part == matchers.AllPart || part == matchers.HeaderPart && headers == "" {
headers = headersToString(resp.Header)
}

headers = headersToString(resp.Header)
// Check if the matcher matched
if !matcher.Match(resp, body, headers) {
// If the condition is AND we haven't matched, try next request.
Expand All @@ -182,10 +176,7 @@ mainLoop:
// next task which is extraction of input from matchers.
var extractorResults []string
for _, extractor := range e.httpRequest.Extractors {
part := extractor.GetPart()
if part == extractors.AllPart || part == extractors.HeaderPart && headers == "" {
headers = headersToString(resp.Header)
}
headers = headersToString(resp.Header)
for match := range extractor.Extract(body, headers) {
extractorResults = append(extractorResults, match)
}
Expand Down

0 comments on commit 606c46b

Please sign in to comment.