Skip to content

WW-5866 Percent-encode WebJar file names in generated URLs - #2163

Open
ciphertrail-x wants to merge 1 commit into
apache:mainfrom
ciphertrail-x:WW-5866-webjar-url-encoding
Open

ciphertrail-x wants to merge 1 commit into
apache:mainfrom
ciphertrail-x:WW-5866-webjar-url-encoding

Conversation

@ciphertrail-x

Copy link
Copy Markdown

Fixes WW-5866.

Percent-encode WebJar file names as UTF-8 when generating a URL. For example, theme;dark.css now produces a URL ending in theme%3Bdark.css, while the classpath lookup still uses theme;dark.css. Directory separators and literal + characters are preserved.

The regression tests cover URL generation, both writer and var output, and classpath lookup. The semicolon test decodes the generated URI, passes the path to the Struts static content loader, and compares the response bytes with the CSS fixture. This test exercises the loader directly.

On JDK 17 and Maven 3.10.0, the root mvn -DskipAssembly verify run passed all 30 modules: 5,271 Surefire tests and 60 Failsafe tests, with zero failures, errors, or skips. An earlier root mvn -DskipAssembly test run stopped during Tiles compilation. The same failure reproduced on the unmodified base commit.

Thanks to Yu Deshui (于得水) for reporting the issue. OpenAI Codex assisted with the implementation, tests, and documentation.

Encode raw WebJar file path names as UTF-8 URL path segments while
preserving separators and leaving classpath resource lookup unchanged.
Add real-provider URL, component output, and resource-content regression
coverage, including semicolons in resource names.

Generated-by: OpenAI Codex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant