Skip to content

Add test that mimics Amazon S3 pre-signed URLs - #1

Open
torarvid wants to merge 1 commit into
builderfrom
head-get-with-redirect
Open

torarvid wants to merge 1 commit into
builderfrom
head-get-with-redirect

Conversation

@torarvid

Copy link
Copy Markdown
Owner

When people use Amazon S3 pre-signed URLs, the client typically makes a request to https://server-a.example.com which will redirect the client to a URL at s3.amazonaws.com. The S3 algorithm includes the HTTP method as part of the signature which in turn is a part of the URL the client is redirected to.

In practice this means if you do a HEAD request to server-a.example.com, you are redirected to an S3 URL that only works with HEAD requests. This means that you can't "cache" the redirect-target URL and then perform a GET request... You will need to do another GET request against server-a.example.com.

This test demonstrates this.

When people use Amazon S3 pre-signed URLs, the client typically makes a
request to https://server-a.example.com which will redirect the client to
a URL at s3.amazonaws.com. The S3 algorithm includes the HTTP method as
part of the signature which in turn is a part of the URL the client is
redirected to.

In practice this means if you do a HEAD request to server-a.example.com,
you are redirected to an S3 URL that only works with HEAD requests. This
means that you can't "cache" the redirect-target URL and then perform a GET
request... You will need to do another GET request against
server-a.example.com.

This test demonstrates this.
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.

1 participant