Skip to content

Add Redirector.MODE_CLIENT_PERMANENT_STRICT answering 308 (#1746) - #1747

Merged
thboileau-git merged 1 commit into
3.0from
feature/1746-redirector-308
Nov 28, 2026
Merged

thboileau-git merged 1 commit into
3.0from
feature/1746-redirector-308

Conversation

@thboileau-git

@thboileau-git thboileau-git commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1746

RFC 9110 section 15.4.9: 308 makes the client repeat the request with the same method and content, unlike 301 which lets a user agent turn a POST into a GET. Status.REDIRECTION_PERMANENT_STRICT existed but nothing could answer with it.

  • Redirector.MODE_CLIENT_PERMANENT_STRICT (value 5, unused until now) answers 308 with the Location header.
  • redirectPermanentStrict(Reference|String) on Response, WrapperResponse (delegation) and ServerResource, and Router.redirectPermanentStrict(pathTemplate, targetUri), next to the 301 helpers.
  • The Javadoc of the 301 helpers and of MODE_CLIENT_PERMANENT no longer promises that the method is kept.
  • Purely additive; no behaviour change for the existing modes. ClientResource redirection-following for unsafe methods is out of scope.
  • Tests: RedirectorTestCase, RouterTestCase, WrapperResponseTestCase, ServerResourceTestCase, ResponseRedirectionTestCase, and a wire-level PermanentRedirectWireTestCase (POST to a strict route answers 308 with Location, the 301 route still answers 301).

Same fix on the other maintained versions: 2.7: #1748, 2.6: #1749

🤖 Generated with Claude Code

RFC 9110 section 15.4.9: 308 makes the client repeat the request with the
same method and content, unlike 301 which lets a user agent turn a POST
into a GET. Status.REDIRECTION_PERMANENT_STRICT existed but nothing could
answer with it.

New mode (value 5) with the helpers of the other modes:
Response, WrapperResponse and ServerResource redirectPermanentStrict, and
Router.redirectPermanentStrict. The Javadoc of the 301 helpers no longer
promises that the method is kept.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@thboileau-git
thboileau-git merged commit 53d18f6 into 3.0 Nov 28, 2026
3 of 4 checks passed
@thboileau-git
thboileau-git deleted the feature/1746-redirector-308 branch November 28, 2026 15:10
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