removed adding headers if empty

This commit is contained in:
phriscage 2018-12-04 14:02:52 -08:00
parent c1710a53c1
commit e7a40530ac

View file

@ -110,8 +110,10 @@ func ensureApigeeClientID(next http.Handler) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var apigeeClientID string
apigeeClientID = currentApigeeClientID(r)
ctx := metadata.AppendToOutgoingContext(r.Context(), apigeeClientIDHeaderName, apigeeClientID)
r = r.WithContext(ctx)
if apigeeClientID != "" {
ctx := metadata.AppendToOutgoingContext(r.Context(), apigeeClientIDHeaderName, apigeeClientID)
r = r.WithContext(ctx)
}
next.ServeHTTP(w, r)
}
}