Implement RFC 9110 redirection and update legacy JMeter redirect#142
Merged
3dgiordano merged 1 commit intoJul 18, 2026
Merged
Conversation
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.
This pull request updates HTTP/2 redirect handling to comply with RFC 9110, specifically ensuring that HTTP 307 and 308 redirects preserve the original HTTP method and request body, as required by the standard. The changes address a known bug in JMeter 5.6.3, which incorrectly rewrote redirected methods to GET and failed to follow some redirects for non-GET/HEAD methods. The update introduces a new utility class to encapsulate the correct redirect logic, modifies both the core client and sampler classes to use this logic, and adds comprehensive tests to verify the new behavior. An opt-out property is provided for users who require legacy (buggy) behavior.
Redirect handling improvements:
Rfc9110Redirectsto encapsulate RFC 9110-compliant redirect logic, including a property (blazemeter.http.legacyRedirectMethodHandling) to opt back into legacy JMeter 5.6.3 behavior.HTTP2JettyClientandHTTP2Samplerto useRfc9110Redirects.isRedirect()for redirect detection, ensuring that 307/308 are handled correctly for all HTTP methods, not just GET/HEAD. [1] [2] [3] [4]Sampler redirect logic fixes:
resultProcessing()andfollowRedirects()inHTTP2Samplerto preserve the original HTTP method and body for 307/308 redirects, as required by RFC 9110, and to use the new redirect detection logic.Testing and validation:
HTTP2JettyClientTestto verify correct redirect behavior for 302, 307, and 308 status codes—including preservation of request body and method, and legacy behavior when the opt-out property is set. [1] [2]ServerBuilderto support the new redirect test cases (302, 307, and 308 redirects to an echo endpoint), and implemented their behavior in the test server logic. [1] [2]