Skip to content

fix: encode location query parameter in init request to preserve +#24089

Merged
mcollovati merged 4 commits intomainfrom
plus-in-route
Apr 8, 2026
Merged

fix: encode location query parameter in init request to preserve +#24089
mcollovati merged 4 commits intomainfrom
plus-in-route

Conversation

@Artur-
Copy link
Copy Markdown
Member

@Artur- Artur- commented Apr 7, 2026

Re-add encodeURIComponent() around the location parameter in the init request query string. Without encoding, a literal + in the URL path (e.g. /+/dashboard) is interpreted as a space by the servlet container's query parameter decoding, resulting in InvalidLocationException: Relative path cannot start with /

The encodeURIComponent was removed in #22791 to preserve %2F in wildcard parameters, but this is not needed: double-encoding (%2F becomes %252F) is correctly undone by the servlet's single query parameter decode.

Artur- added 2 commits April 7, 2026 15:56
Adds a view with @route(":tenant/plus-test") and an IT that navigates
to /+/plus-test to verify that a literal + as the first path segment
is preserved as a route parameter value.
Re-add encodeURIComponent() around the location parameter in the
init request query string. Without encoding, a literal + in the URL
path (e.g. /+/dashboard) is interpreted as a space by the servlet
container's query parameter decoding, resulting in
InvalidLocationException: Relative path cannot start with /

The encodeURIComponent was removed in #22791 to preserve %2F in
wildcard parameters, but this is not needed: double-encoding (%2F
becomes %252F) is correctly undone by the servlet's single query
parameter decode.
@github-actions github-actions bot added the +0.0.1 label Apr 7, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Test Results

 1 390 files  +3   1 390 suites  +3   1h 24m 28s ⏱️ + 1m 12s
 9 939 tests +1   9 868 ✅ +1  71 💤 ±0  0 ❌ ±0 
10 414 runs  +3  10 334 ✅ +3  80 💤 ±0  0 ❌ ±0 

Results for commit a872fe2. ± Comparison against base commit 068aaa2.

♻️ This comment has been updated with latest results.

mcollovati
mcollovati previously approved these changes Apr 8, 2026
Copy link
Copy Markdown
Collaborator

@mcollovati mcollovati left a comment

Choose a reason for hiding this comment

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

Just a comment on the test view, but the fix looks good.

@mcollovati mcollovati enabled auto-merge April 8, 2026 13:23
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 8, 2026

@mcollovati mcollovati added this pull request to the merge queue Apr 8, 2026
Merged via the queue into main with commit adc6694 Apr 8, 2026
31 checks passed
@mcollovati mcollovati deleted the plus-in-route branch April 8, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants