Open aur8l opened 5 years ago
The logic in the MatcherFilter class only looks at whether the body is not null in deciding to return a 404. It doesn't take into account if there was a match on the route. In the code you provided, the after filter modifies the body regardless of whether the route was found. If you were to eliminate the else logic, you'd probably get the result you're looking for.
All that being said, I wonder if it may be better for the framework to detect whether the route was actually handled, as opposed to simply looking at the result.
Hi,
This seems to be a bug. When applying an after filter to a path group, if the route doesn't exist, the status of the response is changed systematically to 200. See below for reproducible example.
A call to /api/whatevs will not return 404, but 200. If I remove the filter, the it does return 404.