diff options
| author | Xe Iaso <me@xeiaso.net> | 2025-04-27 14:02:53 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2025-04-27 14:05:04 -0400 |
| commit | 1d9fa34fa84cc125c68ab486d8bbc2dbe7a51f0e (patch) | |
| tree | 806543b40d615e1bf57d4a83fdba88bb8008e088 /cmd/httpdebug/main.go | |
| parent | 10e176a023ee1a4955160c86f0dc71a435bdf866 (diff) | |
| download | x-1d9fa34fa84cc125c68ab486d8bbc2dbe7a51f0e.tar.xz x-1d9fa34fa84cc125c68ab486d8bbc2dbe7a51f0e.zip | |
feat(httpdebug): quiet mode and function as a systemd service
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd/httpdebug/main.go')
| -rw-r--r-- | cmd/httpdebug/main.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cmd/httpdebug/main.go b/cmd/httpdebug/main.go index 8162bc2..15943b7 100644 --- a/cmd/httpdebug/main.go +++ b/cmd/httpdebug/main.go @@ -14,7 +14,8 @@ import ( ) var ( - bind = flag.String("bind", ":3000", "TCP port to bind to") + bind = flag.String("bind", ":3000", "TCP port to bind to") + silent = flag.Bool("silent", false, "if set, don't log http headers") ) func main() { @@ -34,8 +35,12 @@ func main() { fmt.Fprint(w, "<pre id=\"main\"><code>") } - fmt.Println("---") - r.Write(io.MultiWriter(w, os.Stdout)) + if !*silent { + fmt.Println("---") + r.Header.Write(io.MultiWriter(w, os.Stdout)) + } else { + r.Header.Write(w) + } if contains { fmt.Fprintln(w, "</pre></code>") |
