【发布时间】:2021-01-18 20:33:04
【问题描述】:
在我的代码中,我有以下标签:
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js" integrity="...."></script>
我必须将其格式更改为https,而不是使用http。但是,当我添加 s 并将其更改为 https://... 时,出现以下错误:
Failed to find a valid digest in the 'integrity' atttribute for resource'https://cdnjs..." with computer SHA-256 integrity '...' The resource has been blocked.
【问题讨论】:
-
你尝试过使用
//cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js,这将允许浏览器使用适当的协议,你不需要考虑使用哪个协议?另外,问题可能与您正在访问的资源的 SSL 证书有关?