Skip to content

Commit

Permalink
Refactor to switch/case
Browse files Browse the repository at this point in the history
  • Loading branch information
Luan van Pletsen committed Mar 16, 2018
1 parent 75826d0 commit 5aa0d2a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 5aa0d2a

Please sign in to comment.