【发布时间】:2021-03-02 23:56:33
【问题描述】:
我正在尝试通过消除点击劫持来确保我的 Vue 应用程序的安全。
我不确定如何设置 Vue 服务器的标头、元标记中的 X Frame 或 Frame Ancestor 指令的方法,例如:
<meta http-equiv="Content-Security-Policy" content="X-Frame-Options: DENY:"
/>
但是,下面的链接说这是不受支持的 https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors
我意识到对于API请求,这些标头应该在后端设置,但是,这是加载应用程序的主页(不发出api请求)。
如何在我的 Vue.js 服务器中设置这些标头
【问题讨论】:
标签: javascript html vue.js http-headers content-security-policy