From 6632ef0934b89578305babb577bae3afe9ee6fa7 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sat, 13 Apr 2024 22:59:21 +0300 Subject: [PATCH] fix: response.length always zero (#26) --- dump.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dump.go b/dump.go index 5e970ce..79da02c 100644 --- a/dump.go +++ b/dump.go @@ -21,7 +21,7 @@ type bodyWriter struct { } // implements http.ResponseWriter -func (w bodyWriter) Write(b []byte) (int, error) { +func (w *bodyWriter) Write(b []byte) (int, error) { if w.body != nil { if w.body.Len()+len(b) > w.maxSize { w.body.Write(b[:w.maxSize-w.body.Len()]) @@ -35,14 +35,14 @@ func (w bodyWriter) Write(b []byte) (int, error) { } // implements http.Flusher -func (w bodyWriter) Flush() { +func (w *bodyWriter) Flush() { if w.ResponseWriter.(http.Flusher) != nil { w.ResponseWriter.(http.Flusher).Flush() } } // implements http.Hijacker -func (w bodyWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { +func (w *bodyWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) { if w.ResponseWriter.(http.Hijacker) != nil { return w.ResponseWriter.(http.Hijacker).Hijack() }