Skip to content
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

Safeguard against redirects on PUT request #1418

Merged
merged 2 commits into from
Apr 10, 2024

Conversation

mhutchinson
Copy link
Contributor

A redirect on a PUT request will make the http client perform a GET request to the signposted URL. This will (probably) return a 200, which the code will then interpret as a successful PUT. This check ensures that the method the response relates to is the same as the one we invoked.

A redirect on a PUT request will make the http client perform a GET request to the signposted URL. This will (probably) return a 200, which the code will then interpret as a successful PUT. This check ensures that the method the response relates to is the same as the one we invoked.
@mhutchinson mhutchinson requested a review from a team as a code owner April 10, 2024 13:46
@mhutchinson mhutchinson requested review from jiggoha and AlCutter and removed request for a team April 10, 2024 13:46
Copy link
Member

@AlCutter AlCutter left a comment

Choose a reason for hiding this comment

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

@mhutchinson
Copy link
Contributor Author

Worth adding a comment linking to/quoting https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections#permanent_redirections ?

Done

@mhutchinson mhutchinson merged commit 69dccd1 into google:master Apr 10, 2024
6 checks passed
@mhutchinson mhutchinson deleted the putRequestSafety branch April 10, 2024 14:39
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.

2 participants