From ac5c5e8c655b7f6ccdf387dcfbc750b30111cd4b Mon Sep 17 00:00:00 2001 From: wobondar Date: Fri, 12 Apr 2024 21:51:07 +0300 Subject: [PATCH] fix: response.length always zero --- 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() }