Uploadcare: Optional default URL prefix
Problem: There is no option to disable the URL prefix in the UploadCare settings.
It would be nice to have an option in the nuxt.config.js where if cndURL is false, there is no URL prefix.
If you pass / as a URL, does it behave as you wish?
Sadly, not.. the generated url will look like this:
<img src="/https://ucarecdn.com/5d...53/-/format/auto/-/quality/smart/-/resize/2560x/"
with this config
image: { uploadcare: { cdnURL: '/' } },
I've found no workaround aside from editing the code :)
Please let me know if there is anything I can do :)
seems to work fine for me
https://stackblitz.com/edit/github-kzrcuy?file=nuxt.config.ts,app.vue
Closing as I can't reproduce the original bug and I believe this feature is already implemented, but please do feel free to provide a reproduction of the original issue and we can definitely reopen.
Sorry for the late response! Here is a reproduction of the issue:
https://stackblitz.com/edit/github-kzrcuy-6sn53l?file=app.vue,server%2Fapi%2FheadlessCMS.ts,server%2Ftsconfig.json
As you can see, a " / " is always added at the start. Since I am using a headless CMS (Strapi), it already return the full path: (meaning nothing needs to be added in front of the url)
{
"imageUrl": "https://ucarecdn.com/ed47ee7c-e0c6-41b3-9536-debcfd81afa1/"
}
Solution: If we can set the CDNUrl prefix to false, nothing will be added in front of the already existing URL.
Hey @danielroe , feel free to let me know if I need to clarify a bit more ;)
Oh, I see - if the returned data from CDN already has a protocol. I think the fix instead should be simply not to prefix with cdNURL in that case.
We can test with utilities provided from ufo.