Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 未应用内联样式_Reactjs_Http_Content Security Policy - Fatal编程技术网

Reactjs 未应用内联样式

Reactjs 未应用内联样式,reactjs,http,content-security-policy,Reactjs,Http,Content Security Policy,我的React应用程序从今天起返回此错误: 拒绝应用内联样式,因为它违反了以下内容安全策略指令:“style src‘self’”。启用内联执行需要'unsafe inline'关键字、哈希('sha256-3dqyuwnjybchqe4tykl7xf9jytstrjzwlnutcbu8uig=')或nonce('nonce-…') 我将这个元标记添加到我的index.html <meta http-equiv="Content-Security-Policy" content="defa

我的React应用程序从今天起返回此错误:

拒绝应用内联样式,因为它违反了以下内容安全策略指令:“style src‘self’”。启用内联执行需要'unsafe inline'关键字、哈希('sha256-3dqyuwnjybchqe4tykl7xf9jytstrjzwlnutcbu8uig=')或nonce('nonce-…')

我将这个元标记添加到我的
index.html

<meta http-equiv="Content-Security-Policy" content="default-src https:; script-src https: 'unsafe-inline'; style-src https: 'unsafe-inline';">

相同问题。

可能重复@iamsaksham相同问题,但其解决方案无法解决我的问题。您不能在HTML
元素中设置或更改内容安全策略。这将是一个巨大的后门,可以绕过CSP提供的安全性。如何解决该问题?可能会重复@iamsaksham相同的问题,但他们的解决方案无法解决我的问题。您不能在HTML
元素中设置或更改内容安全策略。这将是一个巨大的后门,以规避CSP提供的安全。如何解决这个问题?
devServer: {
    contentBase: path.resolve('src/www'),
    publicPath: '/',
    port: 8080,
    quiet: false,
    hot: true,
    historyApiFallback: true,
    inline: true
},