Skip to content

Don't start a session for Roller UI stylesheets, scripts and images - #332

Merged
mraible merged 2 commits into
roller-6.1.xfrom
no-salt-for-static-files-6.1.x
Nov 18, 2026
Merged

mraible merged 2 commits into
roller-6.1.xfrom
no-salt-for-static-files-6.1.x

Conversation

@mraible

@mraible mraible commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

The 6.1.x version of #310. 6.1.x's LoadSaltFilter has no rendering-path skip, so only the static-file skip is added, for /roller-ui/styles, /roller-ui/scripts, /roller-ui/images and /roller-ui/theme.

LoadSaltFilterTest: staticFilesGetNoSessionAndNoSalt, which covers all four directories, fails without the change. mvn test passes, and the Selenium integration tests pass.

CHANGES entries for the 6.1.8 fixes will come in one PR.

LoadSaltFilter started a session and put a form salt in the cache for every request under /roller-ui, including the static files in /roller-ui/styles, /roller-ui/scripts and /roller-ui/images. It now passes those straight through.

@snoopdave snoopdave left a comment

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.

Review of 11b220198: The static-file change matches #310; the rendering-path difference is explained by the branch baseline. The new test would fail without this change, but one static asset directory is still missed.

public class LoadSaltFilter implements Filter {

/** Roller UI static files, which never hold a form. */
static final String[] STATIC_PATHS = {"/roller-ui/styles/", "/roller-ui/scripts/", "/roller-ui/images/"};

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.

Important: /roller-ui/theme/ also contains static CSS and images. The frontpage CSS requests images from that directory, and those requests still reach getSession(true) through the /roller-ui/* mapping. Add /roller-ui/theme/ to STATIC_PATHS and cover it in the no-session test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added /roller-ui/theme/ to STATIC_PATHS, and the no-session test now requests /roller-ui/theme/tan/menutab-sel.gif and expects four chained requests. The test fails without the change.

Requests under /roller-ui/theme/, such as the front-page tab images, no longer create a session, and the no-session test covers that directory.
@mraible
mraible requested a review from snoopdave November 18, 2026 04:16

@snoopdave snoopdave left a comment

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.

LGTM

@mraible
mraible merged commit 8855def into roller-6.1.x Nov 18, 2026
7 checks passed
@mraible
mraible deleted the no-salt-for-static-files-6.1.x branch November 18, 2026 04:52
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