Skip to content

Conversation

@gregnr
Copy link

@gregnr gregnr commented Dec 9, 2025

When the s3_endpoint URL contains a path (e.g. https://s3.example.com/some/path) and S3 path-style access is used, s3 requests fail with a 403 Forbidden due to an incorrect AWS AWS4-HMAC-SHA256 signature.

With the above example endpoint, the current logic will:

  1. set host to s3.example.com/some/path
  2. set path /<bucket-name>/<requested-path>

This PR corrects this to:

  1. set host to s3.example.com
  2. set path /some/path/<bucket-name>/<requested-path>

Which fixes the downstream signature that is generated from those values.


An example of an S3-compatible endpoint that does this in practice is Supabase's Storage API, which serves the s3 endpoint from:

https://<project-ref>.storage.supabase.co/storage/v1/s3

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