Skip to content

WW-3655 test(freemarker): guard against resolving the result location from the request URI - #2037

Merged
lukaszlenart merged 1 commit into
mainfrom
WW-3655-freemarker-result-location-test
Oct 16, 2026
Merged

lukaszlenart merged 1 commit into
mainfrom
WW-3655-freemarker-result-location-test

Conversation

@lukaszlenart

Copy link
Copy Markdown
Member

Fixes WW-3655

Summary

WW-3655 reported that FreemarkerResult built a relative (or empty) location from the request URI. A request path could therefore decide which template got loaded. WW-4169 already changed this in 2.3.17: a relative location is now resolved against the action namespace.

This PR adds a regression test only. No production code changes.

Test

FreeMarkerResultTest#testEmptyLocationDoesNotLoadRequestUriAsTemplate sends a request to /com/acme/actions/Action.class/ with an empty result location. A recording StringTemplateLoader holds a template at that path. The test asserts that the loader is never asked for that path and that its content is never written to the response.

  • With the old request-URI resolution temporarily restored, the test fails: the template is loaded and written to the response.
  • On main, it passes (FreeMarkerResultTest 6/6, FreemarkerResultMockedTest 8/8).

🤖 Generated with Claude Code

… from the request URI

The behaviour was changed by WW-4169 (2.3.17): a relative location is
resolved against the action namespace. The test fails when the old
request-URI based resolution is restored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lukaszlenart
lukaszlenart marked this pull request as ready for review October 16, 2026 12:10
@sonarqubecloud

Copy link
Copy Markdown

@lukaszlenart
lukaszlenart merged commit f648b28 into main Oct 16, 2026
8 checks passed
@lukaszlenart
lukaszlenart deleted the WW-3655-freemarker-result-location-test branch October 16, 2026 13:43
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