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

Issue a PUT request after a GET request responding with 202 and a Location header #1464

Merged
merged 6 commits into from
Aug 24, 2020

Conversation

cbliard
Copy link
Contributor

@cbliard cbliard commented Aug 21, 2020

Is your pull request related to a problem? Please describe.

Doing a PUT directly and following redirects has issues as the body gets sent several times: once for initial request, and once for subsequent redirects. The initial request should be sent without any body and only the last one should contain the body.

Describe the solution you have implemented

Setting --out 'url -X GET' will request the given url with GET method, following redirects. If the response is a 202 Accepted and it has a Location HTTP header, then the payload is sent with a PUT request to the given location.

This approach is also a workaround for the limitation of Lambda payload size of 6 MB.

Seb Rose and others added 6 commits August 21, 2020 11:07
Co-authored-by: Aslak Hellesøy <aslak.hellesoy@smartbear.com>
Co-authored-by: Seb Rose <seb.rose@smartbear.com>
Co-authored-by: vincent.capicotto <vincent.capicotto@hiptest.net>
Co-authored-by: Aslak Hellesøy <aslak.hellesoy@smartbear.com>
Co-authored-by: Seb Rose <seb.rose@smartbear.com>
Co-authored-by: vincent.capicotto <vincent.capicotto@hiptest.net>
@cbliard cbliard changed the title When publishing, issue a GET request first to get the S3 URL, and then PUT it on it Follow Location header with a PUT if the status is 202. Don't send body with a GET Aug 21, 2020
@cbliard cbliard changed the title Follow Location header with a PUT if the status is 202. Don't send body with a GET Issue a PUT request after a GET request responding with 202 and a Location header Aug 21, 2020
@cbliard cbliard merged commit da7e49d into master Aug 24, 2020
@cbliard cbliard deleted the get-put-redirect branch August 24, 2020 09:04
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