From c3ff76658a996001dbcee3bde8bc9788cd089f1f Mon Sep 17 00:00:00 2001 From: askuy Date: Fri, 10 May 2024 16:22:19 +0800 Subject: [PATCH] set http custom header --- client/ehttp/interceptor.go | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ehttp/interceptor.go b/client/ehttp/interceptor.go index 0a3388cc..63e5004a 100644 --- a/client/ehttp/interceptor.go +++ b/client/ehttp/interceptor.go @@ -61,6 +61,7 @@ func logAccess(name string, config *Config, logger *elog.Component, req *resty.R for _, key := range loggerKeys { if value := req.Context().Value(key); value != nil { fields = append(fields, elog.FieldCustomKeyValue(key, cast.ToString(value))) + req.SetHeader(key, cast.ToString(value)) } }