fix: prevent error handler from overriding sub handler matchers#6999
Conversation
|
Thanks! Is this really the correct fix though? I imagine there's a JSON structure we can generate that isn't this deep that does it correctly, but I'm not super familiar with the issue right now to know what that would be. |
|
I tried to have something that is similar to what the normal routes already have as per documentation so I see it as something like this: (Not a real example) @status_404 {
status 404
}
handle @status_404 {
handle /en/* { ... }
handle /es/* { ... }
}so the above code if we use Method matcher or any other matcher, it will result in the same depth as what this PR introduced |
|
To summarize the issue, it is mainly due to the following line: caddy/caddyconfig/httpcaddyfile/builtins.go Lines 850 to 852 in 9f71483 It was overriding the
correct case: But if you have sub-routes inside the default |
|
Hi, |
mholt
left a comment
There was a problem hiding this comment.
Sounds good -- thank you for working on this. We'll give it a shot!
Fixes: #6957
It make sure that all routes within the handle_errors are within a subroute.