Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Immediately return if route regex didn't match.
This is for Issue #1187. It's not safe to look at `%+` without first having checked whether the regex matched successfully or not. Otherwise, we might see keys from a previous regex match, because `%+` is only cleared after a successful match. (perldoc perlvar confirms, "Note: "%-" and "%+" are tied views into a common internal hash associated with the last successful regular expression.") Dancer2 doesn't have problems here, as it already returns immediately if the regex didn't match, the same way this change does. Note: I think this would only happen via certain deployment methods, and if there was an earlier route which used named captures. In particular, we never had any problems in our large API app's comprehensive test suite when we used Dancer::Test. We've re-worked our testing framework to use Plack::Test, partially in readyness to switch to Dancer2, and started getting weird failures which were tracked down to incorrect route matching, and this was the cause.
- Loading branch information