Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit b80d423

Browse files
authored
Always return decision in findHandler (#1008)
d36b617 changed the logic in `findHandler` when it comes to returning decision: after d36b617, the decision is only filled out if the predicate matched (otherwise it's `nil`). Previously, the decision would be returned in both scenarios: if predicate matched or if predicate did not match. d36b617 caused a regression in integration tests: if an index is closed in the configuration, the predicate does not match, but the code still needs a decision (with `IsClosed: true`) to be able to return a correct `index_closed_exception` response. Without a decision (`nil`) it wasn't able to return that expected response.
1 parent 64beed6 commit b80d423

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

quesma/quesma/mux/mux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@ func (p *PathRouter) findHandler(req *Request) (handler Handler, decision *table
105105
if pathData, pathMatches := m.compiledPath.Match(path); pathMatches {
106106
req.Params = pathData.Params
107107
predicateResult := m.predicate.Matches(req)
108+
decision = predicateResult.Decision
108109
if predicateResult.Matched {
109110
handler = m.handler
110-
decision = predicateResult.Decision
111111
}
112112
}
113113
}

0 commit comments

Comments
 (0)