Skip to content

Commit

Permalink
Fix # urls
Browse files Browse the repository at this point in the history
  • Loading branch information
liamg committed Jun 22, 2020
1 parent fc742f4 commit cf7fdf2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/scout/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ var urlCmd = &cobra.Command{
select {
case output := <-importantOutputChan:
clearLine()
fmt.Printf(output)
fmt.Print(output)
FLUSH:
for {
select {
Expand All @@ -148,7 +148,7 @@ var urlCmd = &cobra.Command{
return
case output := <-genericOutputChan:
clearLine()
fmt.Printf(output)
fmt.Print(output)
}
}

Expand Down
9 changes: 9 additions & 0 deletions pkg/scan/url_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,18 @@ func (scanner *URLScanner) visited(uri string) bool {
return false
}

func (scanner *URLScanner) clean(url string) string {
if strings.Contains(url, "#") {
return strings.Split(url, "#")[0]
}
return url
}

// hit a url - is it one of certain response codes? leave connections open!
func (scanner *URLScanner) checkURL(job URLJob) *URLResult {

job.URL = scanner.clean(job.URL)

if scanner.visited(job.URL) {
return nil
}
Expand Down

0 comments on commit cf7fdf2

Please sign in to comment.