Support HEAD requests for S3Presigner #5473
Labels
feature-request
A feature should be added or improved.
needs-triage
This issue or PR still needs to be triaged.
Describe the feature
S3Presigner doesn't currently seem to have any API for generating a Presigned URL for a HEAD request.
Please add a method for creating for generating such a URL.
Use Case
I want to generate a head request and a get request for downloading an object from s3. the client makes a head request to poll until the file to download is actually available.
However, there doesn't currently appear to be a way to create a pre-signed s3 request for HEAD requests using the SDK v2 (there was in V1).
Proposed Solution
The most obvious solution would be to add a
presignHeadObject
method to theS3Presigner
class.Another possibility would be to add a method to
S3Presigner
that allows you to give it anysoftware.amazon.awssdk.services.s3.model.S3Request
and generate a signed url for it. It appears that the current implementation uses a pretty generic private method anyway.Finally, another solution could be that S3 could allow you to use a HEAD request with a signed GET request. See below.
Other Information
REFC 7231 (http/1.1) states:
My interpretation of this is that simply changing the method of a request from a GET to a HEAD shouldn't cause a request that would return 200 to return 403 instead.
But I don't know if it is feasible for s3 to change that behavior.
Acknowledgements
AWS Java SDK version used
2.20.68
JDK version used
11.0.24
Operating System and version
Ubuntu 20.04
The text was updated successfully, but these errors were encountered: