Skip to content

remove body on redirection if needed #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2022

Conversation

dbu
Copy link
Contributor

@dbu dbu commented Sep 29, 2022

Q A
Bug fix? yes
New feature? yes
BC breaks? no (except when relying on the behaviour)
Deprecations? no
Related tickets fixes #205
Documentation php-http/documentation#298
License MIT

What's in this PR?

Remove the body and content-type and content-length headers when following a redirection.

Why?

Sending a body to a different target than the intended one is usually not desired and can pose a security risk.

Checklist

@dbu dbu force-pushed the fix/remove-request-body-on-redirect branch 10 times, most recently from 5fae651 to ca4aad4 Compare September 29, 2022 08:48
@GrahamCampbell
Copy link
Contributor

GrahamCampbell commented Sep 29, 2022

This should only be done if there's a change in origin. The title mis-lead me. Having read over the diff, I see the purpose here is to remove the body on GET/HEAD redirect.

@dbu dbu changed the title remove body on redirection remove body on redirection if needed Sep 29, 2022
@dbu dbu force-pushed the fix/remove-request-body-on-redirect branch from ca4aad4 to a48935c Compare September 29, 2022 09:46
@dbu dbu merged commit 45db684 into master Sep 29, 2022
@dbu dbu deleted the fix/remove-request-body-on-redirect branch September 29, 2022 09:59
@dbu
Copy link
Contributor Author

dbu commented Sep 29, 2022

thanks. good point, i fixed the changelog to be clear about when we remove the body, and also explained it in the documentation

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.

RedirectPlugin sends body in GET requests
2 participants