mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
fix: set request ID in tracing context key (#17602)
Since `addCustomerHeaders` middleware was after the `httpTracer` middleware, the request ID was not set in the http tracing context. By reordering these middleware functions, the request ID header becomes available. We also avoid setting the tracing context key again in `newContext`. Bonus: All middleware functions are renamed with a "Middleware" suffix to avoid confusion with http Handler functions.
This commit is contained in:
committed by
GitHub
parent
45a717a142
commit
7af78af1f0
@@ -65,7 +65,7 @@ func getOpName(name string) (op string) {
|
||||
|
||||
// If trace is enabled, execute the request if it is traced by other handlers
|
||||
// otherwise, generate a trace event with request information but no response.
|
||||
func httpTracer(h http.Handler) http.Handler {
|
||||
func httpTracerMiddleware(h http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// Setup a http request response recorder - this is needed for
|
||||
// http stats requests and audit if enabled.
|
||||
|
||||
Reference in New Issue
Block a user