diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/printer.go | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/src/printer.go b/src/printer.go index 291adbb..d33360a 100644 --- a/src/printer.go +++ b/src/printer.go @@ -21,28 +21,32 @@ func printResponses(channels channels) { // codes var statusCode string - switch response.StatusCode { - case 200: - - // jump to the beginning of the line, clear the line, then print - // the response - prefix = "\r\033[K" - statusCode = green(fmt.Sprintf("%d", response.StatusCode)) - postfix = "\n" - - case 404: + var color string + + // default values: clear the line, print, newline, green + prefix = "\r\033[K" + postfix = "\n" + color = "green" + + // hide some of the requests, filter using the status code + for _, codeToHide := range hide.HideCode { + if response.StatusCode == codeToHide { + prefix = "" + postfix = "\033[K\r" + color = "red" + } + } - // print the status code, then clear the line and jump back to - // the beginning + // color + if color == "red" { statusCode = red(fmt.Sprintf("%d", response.StatusCode)) - postfix = "\033[K\r" - - // this prints the 404 line, but prints the entry on the same line - + } else if color == "green" { + statusCode = green(fmt.Sprintf("%d", response.StatusCode)) } - // print the foo + // print the requests fmt.Printf("%s%.7d: %s %s%s", prefix, i, statusCode, response.FuzzWord, postfix) + i++ } log.Printf("%s Done printing the responses", green("[+]")) |