-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestion: add before hook in echo.Response? #176
Closed
cgyy opened this issue
Aug 3, 2015
· 1 comment
· Fixed by open-telemetry/opentelemetry-go-contrib#617 · May be fixed by evantorrie/opentelemetry-go-contrib#648
Closed
Suggestion: add before hook in echo.Response? #176
cgyy opened this issue
Aug 3, 2015
· 1 comment
· Fixed by open-telemetry/opentelemetry-go-contrib#617 · May be fixed by evantorrie/opentelemetry-go-contrib#648
Labels
Comments
I've also got a use case like this. Just before headers are written, we calculate a total request handling time, and put that into a header in the response, so clients can calculate network latency. We do it now by hijacking the ResponseWriter in middleware outside the echo.Router. |
This was referenced Mar 8, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Before allows for a function to be called before the ResponseWriter has been written to. This is
useful for setting headers or any other operations that must happen before a response has been written
For, example, If want to save session in middleware, could write code like this:
The text was updated successfully, but these errors were encountered: