Skip to content
New issue

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

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

Already on GitHub? # to your account

Explicitly handle redirects when doing POST requests #1069

Merged
merged 2 commits into from
Dec 31, 2024
Merged

Conversation

simu
Copy link
Member

@simu simu commented Dec 24, 2024

We explicitly redo POST requests if we get a 301, 302, 307 or 308 status code for the first call. We don't validate that the redirect location has the same domain as the original request, since we already unconditionally follow redirects with the bearer token for GET requests.

Note that this wouldn't be necessary if all Lieutenant APIs would redirect us with a 308 for POST requests.

Checklist

  • Keep pull requests small so they can be easily reviewed.
  • Update tests.
  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency, internal
    as they show up in the changelog

@simu simu added the bug Something isn't working label Dec 24, 2024
@simu simu requested a review from a team as a code owner December 24, 2024 10:22
@simu simu force-pushed the fix/post-redirect branch 2 times, most recently from 3115bc9 to 43f2d65 Compare December 24, 2024 10:25
@simu simu requested a review from a team December 24, 2024 10:30
simu added 2 commits December 31, 2024 13:08
We Explicitly redo `POST` requests if we get a 301, 302, 307 or 308
status code for the first call. We don't validate that the redirect
location has the same domain as the original request, since we already
unconditionally follow redirects  with the bearer token for GET
requests.

Note that this wouldn't be necessary if all Lieutenant APIs would
redirect us with a 308 for POST requests.
@simu simu force-pushed the fix/post-redirect branch from 43f2d65 to 1724311 Compare December 31, 2024 12:08
@simu simu merged commit 54d049a into master Dec 31, 2024
20 checks passed
@simu simu deleted the fix/post-redirect branch December 31, 2024 12:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants