change url mapping wildcard validation config value and address edge case direct mapping#15542
Merged
codeconsole merged 4 commits intoapache:7.1.xfrom Apr 7, 2026
Merged
Conversation
…case direct mapping
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ All tests passed ✅🏷️ Commit: 7a7617f Learn more about TestLens at testlens.app. |
sbglasius
approved these changes
Apr 6, 2026
jamesfredley
approved these changes
Apr 7, 2026
jdaugherty
reviewed
Apr 7, 2026
| // Same wildcard status: preserve URL matcher's original order (stable sort). | ||
| // When validation is disabled, preserve original URL matcher order entirely. | ||
| if (validateWildcardMappings) { | ||
| matches.sort(true) { a, b -> |
Contributor
There was a problem hiding this comment.
@codeconsole do these get run every time? Is there a performance concern here?
Contributor
Author
There was a problem hiding this comment.
@jamesfredley yes, typically 2-5 matches for any given URL, so the sort is sorting a tiny list. The nonRoutingParamCount() does a keySet().count { } iteration over 1-3 params per call. For a 3-element sort, that's ~6 comparisons × ~2 param iterations = ~12 operations. Negligible compared to the HTTP overhead, regex matching in matchAll(), and controller dispatch that surround it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up to #15525
per @matrei
changed the url mapping wildcard validation config value
grails.web.url.mapping.validateWildcards->grail.urlmapping.validateWildcardsand
addressed issue where direct mapping should win over wildcard.