Reactjs 内容安全策略不尊重元标记

Reactjs 内容安全策略不尊重元标记,reactjs,google-chrome,youtube,content-security-policy,production,Reactjs,Google Chrome,Youtube,Content Security Policy,Production,我在部署的React应用程序的Chrome web控制台中遇到以下错误: Refused to frame 'https://www.youtube.com/' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'frame-src' was not explicitly set, so 'default-src' is us

我在部署的React应用程序的Chrome web控制台中遇到以下错误:

Refused to frame 'https://www.youtube.com/' because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'frame-src' was not explicitly set, so 'default-src' is used as a fallback.
但是,我在我的
index.html
中指定了
frame src
,如下代码片段所示:

<meta http-equiv="Content-Security-Policy" content="frame-src https://www.youtube.com/">


错误源是一个YouTube嵌入,当meta标记就位时,嵌入在本地主机上可以正常工作。是什么原因导致此错误仅出现在已部署的React应用程序上?

通过在服务器上添加内容安全策略头修复了此错误。所以它毕竟不是前端代码的问题