removed adding headers if empty
This commit is contained in:
parent
c1710a53c1
commit
e7a40530ac
1 changed files with 4 additions and 2 deletions
|
@ -110,8 +110,10 @@ func ensureApigeeClientID(next http.Handler) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
var apigeeClientID string
|
var apigeeClientID string
|
||||||
apigeeClientID = currentApigeeClientID(r)
|
apigeeClientID = currentApigeeClientID(r)
|
||||||
ctx := metadata.AppendToOutgoingContext(r.Context(), apigeeClientIDHeaderName, apigeeClientID)
|
if apigeeClientID != "" {
|
||||||
r = r.WithContext(ctx)
|
ctx := metadata.AppendToOutgoingContext(r.Context(), apigeeClientIDHeaderName, apigeeClientID)
|
||||||
|
r = r.WithContext(ctx)
|
||||||
|
}
|
||||||
next.ServeHTTP(w, r)
|
next.ServeHTTP(w, r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue