Skip to content
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

imageCacheTag does not check URL for already present parameters #10139

Open
barthy-koeln opened this issue Dec 23, 2024 · 0 comments
Open

imageCacheTag does not check URL for already present parameters #10139

barthy-koeln opened this issue Dec 23, 2024 · 0 comments
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@barthy-koeln
Copy link

barthy-koeln commented Dec 23, 2024

Describe the Bug

Same error as #9880 and #9993 however I can provide a reproducer.

Summary of the error:

In packages/ui/src/elements/Thumbnail/index.tsx

The recently introduced imageCacheTag gets appended to an image URL.
It should check the URL for parameters and append to the parameters list with &param=value instead of a simple ?param=value.

Use-case: I am using a /_next/image?url=https.....jpg&w=384&q=75 URL to generate thumbnails for remotely hosted images.

Appending a ?cacheTag=... breaks the integer parsing for the quality param in next, and will break other hosting services like AWS S3, CloudFront CDN, ...

Link to the code that reproduces this issue

https://github.com/barthy-koeln/payload-repro-cachetag-param

Reproduction Steps

Use the existing user in the sqlite DB ([email protected] as name and pw) or create a new one.
Upload a new Media item, then navigate to its edit page (you should be there after the upload anyway).

The thumbnail is broken.

Which area(s) are affected? (Select all that apply)

area: ui

Environment Info

Binaries:
  Node: 22.12.0
  npm: 10.9.0
  Yarn: 1.22.22
  pnpm: 9.15.0
Relevant Packages:
  payload: 3.9.0
  next: 15.1.0
  @payloadcms/email-nodemailer: 3.9.0
  @payloadcms/graphql: 3.9.0
  @payloadcms/next/utilities: 3.9.0
  @payloadcms/payload-cloud: 3.9.0
  @payloadcms/richtext-lexical: 3.9.0
  @payloadcms/translations: 3.9.0
  @payloadcms/ui/shared: 3.9.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: darwin
  Arch: arm64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

1 participant