mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-19 06:59:50 +02:00
fix modifyResponse middleware incorrect variable substitution
This commit is contained in:
@@ -2,6 +2,7 @@ package middleware
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -42,7 +43,7 @@ func (tr *Trace) WithRequest(req *Request) *Trace {
|
||||
return tr
|
||||
}
|
||||
|
||||
func (tr *Trace) WithResponse(resp *Response) *Trace {
|
||||
func (tr *Trace) WithResponse(resp *http.Response) *Trace {
|
||||
if tr == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -103,7 +104,7 @@ func (m *Middleware) AddTraceRequest(msg string, req *Request) *Trace {
|
||||
return m.AddTracef("%s", msg).WithRequest(req)
|
||||
}
|
||||
|
||||
func (m *Middleware) AddTraceResponse(msg string, resp *Response) *Trace {
|
||||
func (m *Middleware) AddTraceResponse(msg string, resp *http.Response) *Trace {
|
||||
if !m.trace {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user