add request-id from header to error body #726
Answered
by
danielgtaylor
oliverdding
asked this question in
Q&A
-
|
I want to retrive request-id header from request and set it to the error body, but after browsing the code, it's not possible without modifying the source code. Can anyone give me an advice? |
Beta Was this translation helpful? Give feedback.
Answered by
danielgtaylor
Feb 28, 2025
Replies: 1 comment 1 reply
-
|
You can probably use a router-specific middleware for this, or a transformer. Example: https://go.dev/play/p/oJ01FZwBzdj |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
oliverdding
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can probably use a router-specific middleware for this, or a transformer. Example: https://go.dev/play/p/oJ01FZwBzdj