Skip to content

change url mapping wildcard validation config value and address edge case direct mapping#15542

Merged
codeconsole merged 4 commits intoapache:7.1.xfrom
codeconsole:7.1.x-urlmappings-specificity
Apr 7, 2026
Merged

change url mapping wildcard validation config value and address edge case direct mapping#15542
codeconsole merged 4 commits intoapache:7.1.xfrom
codeconsole:7.1.x-urlmappings-specificity

Conversation

@codeconsole
Copy link
Copy Markdown
Contributor

@codeconsole codeconsole commented Apr 1, 2026

Follow up to #15525

per @matrei
changed the url mapping wildcard validation config value
grails.web.url.mapping.validateWildcards -> grail.urlmapping.validateWildcards

and

addressed issue where direct mapping should win over wildcard.

@codeconsole codeconsole marked this pull request as draft April 1, 2026 03:07
@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@testlens-app

This comment has been minimized.

@testlens-app
Copy link
Copy Markdown

testlens-app bot commented Apr 4, 2026

✅ All tests passed ✅

🏷️ Commit: 7a7617f
▶️ Tests: 44430 executed
⚪️ Checks: 35/35 completed


Learn more about TestLens at testlens.app.

@codeconsole codeconsole marked this pull request as ready for review April 6, 2026 00:10
@codeconsole codeconsole merged commit 0ac338c into apache:7.1.x Apr 7, 2026
36 checks passed
// 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 ->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codeconsole do these get run every time? Is there a performance concern here?

Copy link
Copy Markdown
Contributor Author

@codeconsole codeconsole Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@jdaugherty jdaugherty added this to the grails:7.1.0 milestone Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants