Skip to content

Commit 8da89a7

Browse files
committed
fix: verbose mode
1 parent ef7d746 commit 8da89a7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

main.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"log"
88
"net/http"
9+
"net/http/httputil"
910
"os"
1011
"os/signal"
1112
"path"
@@ -16,7 +17,7 @@ import (
1617
"github.com/gorilla/mux"
1718
)
1819

19-
const version = "1.3.0"
20+
const version = "1.3.1"
2021

2122
var (
2223
hostv6 = flag.String("hostv6", "[::1]", "IPv6 host to listen on")
@@ -40,6 +41,14 @@ func printv() {
4041

4142
func ListenHandler(w http.ResponseWriter, r *http.Request) {
4243
w.WriteHeader(*status)
44+
45+
if *verbose {
46+
requestDump, err := httputil.DumpRequest(r, true)
47+
if err != nil {
48+
fmt.Println(err)
49+
}
50+
fmt.Printf("%s\n\n", string(requestDump))
51+
}
4352
}
4453

4554
func Init() {

0 commit comments

Comments
 (0)