staticfile / static

开放静态文件 - 为开源库提供稳定、快速的免费 CDN 服务

Home Page:https://staticfile.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wrong content type for mjs

lexdene opened this issue · comments

I got an error:

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/octet-stream". Strict MIME type checking is enforced for module scripts per HTML spec.

I think it is caused by the wrong content type of mjs by cdn.staticfile.org:

$ curl -i https://cdn.staticfile.org/element-plus/2.4.3/index.full.mjs 2>/dev/null | grep -i content-type
content-type: application/octet-stream

A simple way to reproduce this error:

<!DOCTYPE html>
<html>
  <body>
    <script type="module" src="https://cdn.staticfile.org/element-plus/2.4.3/index.full.mjs"></script>
  </body>
</html>

this error happens again.

$ curl -i https://cdn.staticfile.org/element-plus/2.4.3/index.full.mjs 2>/dev/null | grep -i ^content-type
content-type: application/octet-stream

also after I use staticfile.net:

$ curl -i https://cdn.staticfile.net/element-plus/2.4.3/index.full.mjs 2>/dev/null | grep -i ^content-type
content-type: application/octet-stream

@boon755

commented

issue fixed
1