SVGs breaking when served by the CDN - webp

Some SVGs seem to be served as webp files by the CDN.

The CDN does not change the file ending to .webp which results in broken images.

Example: https://logtrade.cdn.prismic.io/logtrade/f7439dd5-094a-4115-963d-9379c499b68c_Gordon_logotype_black-1024x224-1.svg?auto=format&fit=max&w=3840

This has not been an issue before, any updates on what might be causing this?

Hello @michal1, this is the expected behavior of SVG files. We changed this a while ago due to security issues. Learn more about this change.

Hi @Pau, thanks for the response. Could you help me understand why some SVGs work while others don't?

This one seems to be working just fine
https://logtrade.cdn.prismic.io/logtrade/a7c0a5a6-305e-43f8-bfd4-ec6e0ec8db62_fedex-express.svg?auto=format&fit=max&w=3840

Hey there, some of the images that were uploaded before we implemented this changed, and kept their old behavior. It is probably the reason you can still find SVGs with this particularity.

Hi again @Pau,

Is there any way to use SVGs with Prismic at all? The blog post you refer to in the original answer only mentions the fact that SVGs are served as files from the CDN instead of the images.prismic domain as done previously. But, the served files are broken. The CDN serves a .webp file with an .svg ending essentially breaking any downstream decoding.

You can use SVGs safely. We made a change so that it didn’t compromise the security of the files since they are vulnerable to JS access. The only thing these files don't have is access to the Imgix integration, which allows for image optimization features.