Replies: 1 comment
-
|
Try this: func Notify(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
var buf bytes.Buffer
ww := middleware.NewWrapResponseWriter(w, r.ProtoMajor)
ww.Tee(&buf)
next.ServeHTTP(ww, r)
fmt.Println(buf.String())
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wanna send the response value from the handler to the middleware, note that the middleware executes the next handler first, my little try looks like this. I tried setting value in the context but failed it comes back nil.
Beta Was this translation helpful? Give feedback.
All reactions