From cf7fdf280200001221b0b5c87001ac24054550ab Mon Sep 17 00:00:00 2001 From: Liam Galvin Date: Mon, 22 Jun 2020 17:24:01 +0100 Subject: [PATCH] Fix # urls --- cmd/scout/url.go | 4 ++-- pkg/scan/url_scanner.go | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/cmd/scout/url.go b/cmd/scout/url.go index f85ff48..dfffcd1 100644 --- a/cmd/scout/url.go +++ b/cmd/scout/url.go @@ -132,7 +132,7 @@ var urlCmd = &cobra.Command{ select { case output := <-importantOutputChan: clearLine() - fmt.Printf(output) + fmt.Print(output) FLUSH: for { select { @@ -148,7 +148,7 @@ var urlCmd = &cobra.Command{ return case output := <-genericOutputChan: clearLine() - fmt.Printf(output) + fmt.Print(output) } } diff --git a/pkg/scan/url_scanner.go b/pkg/scan/url_scanner.go index 9f727e9..5192219 100644 --- a/pkg/scan/url_scanner.go +++ b/pkg/scan/url_scanner.go @@ -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 }