-
Notifications
You must be signed in to change notification settings - Fork 306
fix(ipx): encode ampersands in image uris #2005
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
base: main
Are you sure you want to change the base?
Conversation
Deploying nuxt-image with Β
|
| Latest commit: |
178c5a0
|
| Status: | Β β Β Deploy successful! |
| Preview URL: | https://d43e5445.nuxt-image.pages.dev |
| Branch Preview URL: | https://feat-encode-reserved-charact.nuxt-image.pages.dev |
commit: |
Codecov Reportβ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2005 +/- ##
========================================
- Coverage 7.02% 7.01% -0.01%
========================================
Files 77 77
Lines 3575 3576 +1
Branches 138 138
========================================
Hits 251 251
- Misses 3276 3277 +1
Partials 48 48 β View full report in Codecov by Sentry. π New features to boost your workflow:
|
|
@danielroe, thank you for your work. I integrated your refactoring (locally) into my branch. I think we might be encountering a bug in ipx β I pulled the latest ipx version locally and the 500 error seems to have to do with the order of the modifiers in the URL. http://localhost:3001/embed%26f_webp%26s_400x400/picsum/id/237/600 does work, http://localhost:3001/q_20%26embed%26f_webp%26s_400x400/picsum/id/237/600 respectively using the quality modifier as the first modifier in the URL does trigger the 500 error (that you also encountered in the playground).
(The error is only triggered, when I use the encoded ampersands, http://localhost:3001/q_20&embed&f_webp&s_400x400/picsum/id/237/600 is fine.) Where should we go from here? File a bug over at https://github.com/unjs/ipx? |
|
interesting. yes, in that case let's fix the issue in ipx (or if it is as simple as sorting modifiers alphabetically we can do that in nuxt/image as a hotfix) |
|
@riddla I investigated and the issue is that the decoding happens after splitting by modifier, which must be either we could either open a PR to ipx to decode the entire string first, or possibly we might choose a different separator? @pi0 may have some thoughts here. |
|
if sorting can be a hotfix here would be great. in next major of IPX later we can change sep and make it configurable. |
|
Just for reference: I re-tested the Slack behavior regarding ampersands this morning with https://www.buescher.de/_ipx/fit_inside&f_jpg&s_1200x630/img/preview/home.jpg respectively https://www.buescher.de/_ipx/fit_inside%26f_jpg%26s_1200x630/img/preview/home.jpg. |
... and update test snapshots for consistency nuxt#2005 (comment)


π Linked issue
closes #1268
β Type of change
π Description
this encodes ampersands in image uris for ipx
remake of #1268 by @riddla as I don't have permission to push to that branch