No blacklist headers for backends
@@ -145,18 +145,15 @@ func (b *Backend) RoundTrip(req *http.Request) (*http.Response, error) {
}
}
- var isResourceReq bool
- if is, ok := req.Context().Value(request.IsResourceReq).(bool); ok {
- isResourceReq = is
- }
-
- if isResourceReq && beresp.StatusCode == http.StatusUnauthorized {
- if memStore, ok := req.Context().Value(request.TokenEndpoint).(*cache.MemoryStore); ok {
+ if is, ok := req.Context().Value(request.IsResourceReq).(bool); ok && is {
+ if beresp.StatusCode == http.StatusUnauthorized {
+ if memStore, ok := req.Context().Value(request.MemStore).(*cache.MemoryStore); ok {
if key, ok := req.Context().Value(request.TokenKey).(string); ok && key != "" {
memStore.Del(key)
}
}
}
+ }
if b.openAPIValidator != nil {
if err = b.openAPIValidator.ValidateResponse(beresp); err != nil {
@@ -176,15 +173,6 @@ func (b *Backend) RoundTrip(req *http.Request) (*http.Response, error) {
removeConnectionHeaders(req.Header)
}
- // FIXME:
- // for _, key := range headerBlacklist {
- // if isResourceReq && strings.ToLower(key) == "authorization" {
- // continue
- // }
-
- // headerCtx.Del(key)
- // }
-
// Backend response context creates the beresp variables in first place and applies this context
// to the current beresp obj. Downstream response context evals reading their beresp variable values
// from this result. Fallback case is for testing purposes.
