Skip to content

Implement RFC 9110 redirection and update legacy JMeter redirect#142

Merged
3dgiordano merged 1 commit into
developmentfrom
FEATURE-RFC9110-REDIRECT-METHOD-PRESERVATION
Jul 18, 2026
Merged

Implement RFC 9110 redirection and update legacy JMeter redirect#142
3dgiordano merged 1 commit into
developmentfrom
FEATURE-RFC9110-REDIRECT-METHOD-PRESERVATION

Conversation

@3dgiordano

Copy link
Copy Markdown
Collaborator

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:

  • Introduced the new utility class Rfc9110Redirects to encapsulate RFC 9110-compliant redirect logic, including a property (blazemeter.http.legacyRedirectMethodHandling) to opt back into legacy JMeter 5.6.3 behavior.
  • Updated HTTP2JettyClient and HTTP2Sampler to use Rfc9110Redirects.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:

  • Overrode resultProcessing() and followRedirects() in HTTP2Sampler to 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:

  • Expanded test coverage in HTTP2JettyClientTest to 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]
  • Added new server endpoints in ServerBuilder to 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]

@3dgiordano
3dgiordano merged commit 16d63d7 into development Jul 18, 2026
2 checks passed
@3dgiordano
3dgiordano deleted the FEATURE-RFC9110-REDIRECT-METHOD-PRESERVATION branch July 18, 2026 22:11
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