diff --git a/api_definition.go b/api_definition.go index e3833ab2369..1d8396702fd 100644 --- a/api_definition.go +++ b/api_definition.go @@ -913,16 +913,16 @@ func (a *APISpec) CheckSpecMatchesStatus(r *http.Request, rxPaths []URLSpec, mod if !match { // check for special case when using url_rewrites with transform_response // and specifying the same "path" expression - - if mode == TransformedResponse { + switch mode{ + case TransformedResponse: if v.TransformResponseAction.Path != ctxGetUrlRewritePath(r) { continue } - } else if mode == HeaderInjectedResponse { + case HeaderInjectedResponse: if v.InjectHeadersResponse.Path != ctxGetUrlRewritePath(r) { continue } - } else { + default: continue } }