gpt4 book ai didi

twitter-bootstrap - 如何解决 “resource requires the request to be CORS enabled… resource has been blocked because the integrity cannot be enforced” 错误

转载 作者:技术小花猫 更新时间:2023-10-29 10:31:23 25 4
gpt4 key购买 nike

我在我的项目中使用了 Bootstrap 图标,这给了我错误

Subresource Integrity: The resource 'http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' has an integrity attribute, but the resource requires the request to be CORS enabled to check the integrity, and it is not. The resource has been blocked because the integrity cannot be enforced.

任何人都可以帮我解决这个问题,当我们转向生产时,图标没有加载。

所以我使用下面的链接作为 Bootstrap 图标

%link{:href => "http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css", :integrity => "sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7", :rel => "stylesheet"}/

最佳答案

我认为您缺少 crossorigin="anonymous"

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

When the request doesn't match Same Origin Policy the crossorigin attribute MUST be present for the integrity of the file to be checked. With an integrity set on an external origin and a missing crossorigin the browser will choose to 'fail-open' which means it will load the resource as if the integrity attribute was not set.

Source

关于twitter-bootstrap - 如何解决 “resource requires the request to be CORS enabled… resource has been blocked because the integrity cannot be enforced” 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35323268/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com