feat expose RequestIDHeaderKey globally

This commit is contained in:
Samuel Berthe
2024-03-19 00:42:45 +01:00
parent 41264887e5
commit fc932ebefd
+3 -2
View File
@@ -15,8 +15,6 @@ import (
const ( const (
customAttributesCtxKey = "slog-gin.custom-attributes" customAttributesCtxKey = "slog-gin.custom-attributes"
requestIDCtx = "slog-gin.request-id" requestIDCtx = "slog-gin.request-id"
// Formatted with http.CanonicalHeaderKey
requestIDHeaderKey = "X-Request-Id"
) )
var ( var (
@@ -34,6 +32,9 @@ var (
HiddenResponseHeaders = map[string]struct{}{ HiddenResponseHeaders = map[string]struct{}{
"set-cookie": {}, "set-cookie": {},
} }
// Formatted with http.CanonicalHeaderKey
RequestIDHeaderKey = "X-Request-Id"
) )
type Config struct { type Config struct {