staticallyio / statically

The CDN for developers.
https://statically.io
MIT License
585 stars 91 forks source link

could not load image The Decoder does not support the image format `Unsupported image format` #100

Open vishvajit79 opened 2 years ago

vishvajit79 commented 2 years ago

Recently, I have been getting CORB error in the new Chrome browser when trying to load the image that uses the width resize feature. If the URL contains the w=X then the response header Content-Type value is text/plain which causes the browser to not display the image. Below is the example

NOT WORKING URL: https://cdn.statically.io/img/www.shopkick.com/w=202,q=100,f=auto/wp-content/uploads/2021/02/2-3.png

❯ curl -I https://cdn.statically.io/img/www.shopkick.com/w\=202,q\=100,f\=auto/wp-content/uploads/2021/02/2-3.png
HTTP/2 200
alt-svc: h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400
access-control-allow-origin: *
access-control-expose-headers: *
cache-control: public, max-age=5
content-type: text/plain
date: Fri, 20 May 2022 18:35:08 GMT
etag: W/"e818a53408c43e4a19343fbb64845b59180a37864bc3e639bdc6d79336e7f5f3"
server: statically
strict-transport-security: max-age=31536000; includeSubDomains; preload
timing-allow-origin: *
vary: Accept-Encoding
x-cache: MISS
x-content-type-options: nosniff
x-served-by: cache-yyz4521-YYZ
content-length: 93

WORKING URL: https://cdn.statically.io/img/www.shopkick.com/q=100,f=auto/wp-content/uploads/2021/02/2-3.png

❯ curl -I https://cdn.statically.io/img/www.shopkick.com/q\=100,f\=auto/wp-content/uploads/2021/02/2-3.png
HTTP/2 301
alt-svc: h3=":443";ma=86400,h3-29=":443";ma=86400,h3-27=":443";ma=86400
access-control-allow-origin: *
access-control-expose-headers: *
cache-control: public, max-age=5
date: Fri, 20 May 2022 18:35:59 GMT
location: https://www.shopkick.com/wp-content/uploads/2021/02/2-3.png
server: statically
strict-transport-security: max-age=31536000; includeSubDomains; preload
timing-allow-origin: *
x-cache: HIT
x-content-type-options: nosniff
x-served-by: cache-yyz4530-YYZ
content-length: 30

I am just wondering is the issue caused due to a redirect in the image url?