Skip to content

Commit

Permalink
Fix path bug
Browse files Browse the repository at this point in the history
  • Loading branch information
liamg committed Dec 16, 2019
1 parent bfc1c7b commit 8d64b96
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/scan/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io/ioutil"
"net/http"
"net/url"
"strings"
"sync"

"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -73,7 +74,10 @@ func (scanner *Scanner) Scan() ([]url.URL, error) {
logrus.Debug("Adding jobs...")

// add urls to scan...
prefix := scanner.options.TargetURL
prefix := scanner.options.TargetURL.String()
if !strings.HasSuffix(prefix, "/") {
prefix = prefix + "/"
}
for {
if word, err := scanner.options.Wordlist.Next(); err != nil {
if err != io.EOF {
Expand All @@ -84,11 +88,7 @@ func (scanner *Scanner) Scan() ([]url.URL, error) {
if word == "" {
continue
}
segment, err := url.Parse(word)
if err != nil {
continue
}
uri := prefix.ResolveReference(segment).String()
uri := prefix + word
jobs <- uri
for _, ext := range scanner.options.Extensions {
jobs <- uri + "." + ext
Expand Down

0 comments on commit 8d64b96

Please sign in to comment.