The h query arg is preventing access to S3FS image derivatives

Created on 9 July 2024, 5 months ago

Problem/Motivation

The h query arg which gets added by crop_file_url_alter prevents access to S3 image style derivatives.

I'm not sure of the exact root cause or the exact fix, but manually removing the h parameter from the URL allows access to the S3 image again.

For example, an image I uploaded to S3 will have the following URL when first displayed on the frontend:

https://local.ddev.site/s3/files/styles/hero_xl_1x/s3/2024-07/kingyoshi....

which gets redirected to the following by NewS3fsImageStyleDownloadController::deliver:

https://s3.amazonaws.com/bucketname/styles/thumbnail/s3/2024-07/kingyosh...

The above s3 URL gives me a 403 Forbidden with the following error message:

The request signature we calculated does not match the signature you provided. Check your key and signing method.

But if I remove the h parameter I can access the image without an issue.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom Baysaa

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Baysaa
  • Merge request !12Fix #3460275 → (Open) created by Baysaa
  • Pipeline finished with Success
    5 months ago
    Total: 178s
    #219881
  • Pipeline finished with Success
    4 months ago
    Total: 396s
    #238512
Production build 0.71.5 2024