【发布时间】:2021-11-21 06:43:53
【问题描述】:
我发现了一个问题,如果我使用与协议无关的 url 加载脚本模块,它将无法加载。
<script type="module" src="//briskreader.com/components/feed-list.js"></script>
如果我从http://localhost:8080 提供 html 文件,它将不会加载。我得到一个cors错误。 (cors 标头在服务器上,所以它应该可以工作)......但是浏览器不喜欢协议无关 url 的 301 重定向,或者我忽略了一些东西。
如果我使用 https:它可以正常工作:(即使来自 http)
<script type="module" src="https://briskreader.com/components/feed-list.js"></script>
我正在使用 nginx...我只是好奇处理这个问题的正确方法是什么
【问题讨论】:
-
我删除了标签