Skip to content

Preserve request body on cross-origin 307 and 308 redirects#2460

Merged
sindresorhus merged 1 commit into
mainfrom
fix-307-308-cross-origin-body
Jun 28, 2026
Merged

Preserve request body on cross-origin 307 and 308 redirects#2460
sindresorhus merged 1 commit into
mainfrom
fix-307-308-cross-origin-body

Conversation

@sindresorhus

Copy link
Copy Markdown
Owner

307 and 308 must preserve the request method and body per RFC 9110, even across origins. Got was dropping the body on cross-origin redirects, producing a POST with an empty body, which matched neither the spec nor a GET conversion and diverged from every other client (browsers, undici, curl, ky all preserve the body and strip only credentials).

Fixes #2459

307 and 308 must preserve the request method and body per RFC 9110, even across origins. Got was dropping the body on cross-origin redirects, producing a POST with an empty body, which matched neither the spec nor a GET conversion and diverged from every other client (browsers, undici, curl, ky all preserve the body and strip only credentials).

Fixes #2459
@sindresorhus
sindresorhus merged commit aee9249 into main Jun 28, 2026
4 checks passed
@sindresorhus
sindresorhus deleted the fix-307-308-cross-origin-body branch June 28, 2026 09:45

@tavanh2025123-netizen tavanh2025123-netizen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9d2473

@tavanh2025123-netizen tavanh2025123-netizen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1890

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.

307 & 308 redirect should preserve body per RFC

2 participants