Skip to content

Commit 45f3e04

Browse files
committed
Print statuscodes between 300-400 in orange and 200-300 in green
1 parent a517f94 commit 45f3e04

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libs/fourohme/utils.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ func GetHostAndPath(parsedURL *url.URL) (string, string) {
2929

3030
func printOutput(statusCode int, verb string, url string, headers []Header) {
3131
// Print in green if it's 200
32-
if statusCode == 200 {
32+
if statusCode >= 200 && statusCode < 300 {
3333
fmt.Printf("\033[32m%d => HTTP %s %s %v\033[0m\n", statusCode, verb, url, headers)
34+
} else if statusCode >= 300 && statusCode < 400 {
35+
fmt.Printf("\033[33m%d => HTTP %s %s %v\033[0m\n", statusCode, verb, url, headers)
3436
} else {
3537
fmt.Printf("\033[31m%d => HTTP %s %s %v\033[0m\n", statusCode, verb, url, headers)
3638
}

0 commit comments

Comments
 (0)