mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 01:38:50 +02:00
support variables in modify request,response middlewares
This commit is contained in:
@@ -97,10 +97,16 @@ func (m *Middleware) AddTracef(msg string, args ...any) *Trace {
|
||||
}
|
||||
|
||||
func (m *Middleware) AddTraceRequest(msg string, req *Request) *Trace {
|
||||
if !m.trace {
|
||||
return nil
|
||||
}
|
||||
return m.AddTracef("%s", msg).WithRequest(req)
|
||||
}
|
||||
|
||||
func (m *Middleware) AddTraceResponse(msg string, resp *Response) *Trace {
|
||||
if !m.trace {
|
||||
return nil
|
||||
}
|
||||
return m.AddTracef("%s", msg).WithResponse(resp)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user