Skip to content

Commit

Permalink
fix: response.length always zero (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
wobondar authored Apr 13, 2024
1 parent 68d7091 commit 6632ef0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()])
Expand All @@ -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()
}
Expand Down

0 comments on commit 6632ef0

Please sign in to comment.