Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move headerKey initialization during response modifier init…
Browse files Browse the repository at this point in the history
…ialization;
riandyrn committed Aug 5, 2024
1 parent 0fb3a5e commit 10e1b73
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions config.go
Original file line number Diff line number Diff line change
@@ -174,13 +174,13 @@ func ResponseModifierTraceIDResponseHeader(opt ResponseModifierTraceIDResponseHe
panic(err)
}

return func(ctx context.Context, w http.ResponseWriter) {
// set the response header key
headerKey := DefaultTraceResponseHeaderKey
if opt.HeaderKeyFunc != nil {
headerKey = opt.HeaderKeyFunc()
}
// set the response header key
headerKey := DefaultTraceResponseHeaderKey
if opt.HeaderKeyFunc != nil {
headerKey = opt.HeaderKeyFunc()
}

return func(ctx context.Context, w http.ResponseWriter) {
// set the trace id into response header, please note that even though the trace
// is not sampled, its id will be still set into the response header. If this
// behavior is not desirable you can create your own response modifier.

0 comments on commit 10e1b73

Please sign in to comment.