CXF-8746: Support forcing GET method on 301/302 redirects#2952
Open
CXF-8746: Support forcing GET method on 301/302 redirects#2952
Conversation
Add http.redirect.force.GET property to HTTPConduit that, when enabled, changes the request method from POST to GET on 301/302 redirects per RFC 7231 Sections 6.4.2/6.4.3 historical behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
http.redirect.force.GETproperty toHTTPConduitthat changes the request method from POST to GET on 301 (Moved Permanently) and 302 (Found) redirectstrueMessage.HTTP_REQUEST_METHODon the outMessage beforeretransmit(), which naturally flows throughsetupConnection()and skips body output for GETUsage
Or via Spring/Blueprint configuration:
With the context property
http.redirect.force.GETset totrue.Context
Supersedes #977 with a cleaner, non-API-breaking approach. The original PR threaded a
boolean forceGETparameter through abstract method signatures across multiple transport implementations (URLConnection, HC5, Netty), which was overly invasive. This implementation requires changes only inHTTPConduit.javaand follows the same pattern as existinghttp.redirect.*properties.Test plan
HTTPConduitURLEasyMockTestredirect tests pass🤖 Generated with Claude Code