Contentful asset URLs

A reader pointed out that the images on my RSS feed don’t load. I was surprised by this because they load fine for me on FeedBin. Looking at the URLs being generated, I immediately realized the issue. To play it safe (I assume?), Contentful returns ass…


This content originally appeared on Jonnie Hallman (@destroytoday) and was authored by Jonnie Hallman (@destroytoday)

A reader pointed out that the images on my RSS feed don’t load. I was surprised by this because they load fine for me on FeedBin. Looking at the URLs being generated, I immediately realized the issue. To play it safe (I assume?), Contentful returns asset URLs without an http or https protocol (e.g., //path/to/my/asset.webp). This lets the browser match the protocol of the current page’s URL. While my RSS reader doesn’t have a problem loading images, my guess is that other readers handle URLs without protocols the same way that browsers do when entered in the address bar—prepending file:, assuming it’s a local file. While I don’t love that I needed to do this, I added https: to all asset URLs.

Reply via email


This content originally appeared on Jonnie Hallman (@destroytoday) and was authored by Jonnie Hallman (@destroytoday)


Print Share Comment Cite Upload Translate Updates
APA

Jonnie Hallman (@destroytoday) | Sciencx (2020-05-19T08:41:00+00:00) Contentful asset URLs. Retrieved from https://www.scien.cx/2020/05/19/contentful-asset-urls/

MLA
" » Contentful asset URLs." Jonnie Hallman (@destroytoday) | Sciencx - Tuesday May 19, 2020, https://www.scien.cx/2020/05/19/contentful-asset-urls/
HARVARD
Jonnie Hallman (@destroytoday) | Sciencx Tuesday May 19, 2020 » Contentful asset URLs., viewed ,<https://www.scien.cx/2020/05/19/contentful-asset-urls/>
VANCOUVER
Jonnie Hallman (@destroytoday) | Sciencx - » Contentful asset URLs. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2020/05/19/contentful-asset-urls/
CHICAGO
" » Contentful asset URLs." Jonnie Hallman (@destroytoday) | Sciencx - Accessed . https://www.scien.cx/2020/05/19/contentful-asset-urls/
IEEE
" » Contentful asset URLs." Jonnie Hallman (@destroytoday) | Sciencx [Online]. Available: https://www.scien.cx/2020/05/19/contentful-asset-urls/. [Accessed: ]
rf:citation
» Contentful asset URLs | Jonnie Hallman (@destroytoday) | Sciencx | https://www.scien.cx/2020/05/19/contentful-asset-urls/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.