Skip to content

Check for unsupported HEAD before failing request #551

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

Merged
merged 1 commit into from
Apr 29, 2025
Merged

Conversation

motz0815
Copy link
Contributor

Closes #549

This is a new approach to handling failing HEAD requests, derived from the discussion in #550

Basically, this PR re-orders the conditional failing of a request if the HEAD fetching did not work as expected. For example, presigned S3 URLs do not support HEAD requests and respond with a 403.

Also, isHeadUnsupportedResponse now returns true as well when the HEAD response was a 403. (to gracefully handle the before mentioned).

Testing with the following URL (expiring on May 5th) now works as expected (also determining the right filename):

Details

https://nbg1.your-objectstorage.com/ziffer-artifacts-staging/builds/4e8f7980-3955-48c4-9ff9-9a8dbedcbf41/test-plugin-1.0-SNAPSHOT.jar?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=6OL4X4U2SMEH6AKWA71D/20250428/auto/s3/aws4_request&X-Amz-Date=20250428T135531Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=0832406b9351cda79525911df41b7f76166993eb0949e9ab4135cd07c904c64a

instead of failing the request early because a HEAD on this URL returns 403.

Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

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

Thanks for the follow up!

@itzg itzg merged commit 76c76c2 into itzg:master Apr 29, 2025
1 check passed
@itzg itzg added the enhancement New feature or request label Apr 29, 2025
@itzg
Copy link
Owner

itzg commented Apr 29, 2025

This is now included in the latest itzg/minecraft-server image build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mcopy: avoid use of HEAD to determine filename since some object storage returns 403
2 participants