【发布时间】:2020-03-10 12:19:18
【问题描述】:
我尝试为firefox通过代理访问的每个请求的响应加入csp标头,但没有发送csp报告,并尝试在mac firefox中做同样的事情(相同的代码),程序运行没有问题,我recv csp报告,所以我认为这可能是centos中firefox的问题
这是我的环境,yum安装firefox,代码使用selenium操作firefox并使用browsermob添加csp header作为响应,代码结果csp header已经添加在response中,firefox处于无头模式。
centos 7
firefox.x86_64 68.5.0-2.el7.centos @update
firefox.i686 68.5.0-2.el7.centos update
firefox-noscript.noarch 11.0.3-3.el7 epel
firefox-pkcs11-loader.x86_64 3.13.4-1.el7 epel
这是我的 csp 规则
Content-Security-Policy-Report-Only: script-src 'none'; style-src 'none'; img-src 'none'; font-src 'none'; connect-src 'none'; media-src 'none'; object-src 'none'; child-src 'none'; frame-src 'none'; worker-src 'none'; worker-src 'none'; worker-src 'none'; base-uri 'none'; manifest-src 'none'; report-uri http://www.test.com
我使用它来接收 csp 报告并使用此报告为 web 创建 csp 规则
有什么办法可以解决这个问题
【问题讨论】:
标签: selenium selenium-webdriver firefox content-security-policy selenium-firefoxdriver