-
Notifications
You must be signed in to change notification settings - Fork 511
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
fix(prerender): decode urls to allow comma in the x-nitro-prerender
header
#799
Conversation
x-nitro-prerender
header
src/prerender.ts
Outdated
_links.push(...header.split(",").map((i) => i.trim())); | ||
_links.push(...header.split(",") | ||
.map((i) => decodeURIComponent(i)) | ||
.map((i) => i.trim())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move trim before decode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good catch. I've updated the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THanks!
_links.push(...header.split(",").map((i) => i.trim())); | ||
_links.push(...header.split(",") | ||
.map((i) => i.trim()) | ||
.map((i) => decodeURIComponent(i)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are missing a ) here:
.map((i) => decodeURIComponent(i)); | |
.map((i) => decodeURIComponent(i))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my bad. Fixed it in #801. π
Hey, first timer here π.
π Linked issue
nuxt/image#701
β Type of change
π Description
When using
@nuxt/image-edge
with Nuxt 3 the default image provider is IPX which allows arbitrary image manipulation through URLs.When using multiple transformations on an image the different transformations are seperated by a comma like this in the final image URL:
@nuxt/image-edge
appends these URLs to theX-Nitro-Prerender
header without encoding the URL.The header will then be split by "," when prerendering the site which leads to the following URLs being prerendered:
This results in some images not being properly prerendered and/or missing in the final output build when running
yarn run generate
π Checklist