centos中的Firefox设置csp标头无效

问题描述 投票:0回答:1

我尝试加入csp标头,以响应由firefox通过代理访问的每个请求的响应,但是没有发送csp报告,并尝试在mac firefox中执行相同的操作(相同的代码),程序运行没有问题,我recv CSP报告,所以我认为这可能是Firefox的centos问题

这是我的环境,由yum安装firefox,代码使用selenium操作firefox并使用browsermob在响应中添加csp标头,因为代码结果csp标头已在响应中添加,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报告并使用此报告为网络创建csp规则

有什么办法解决这个问题

selenium selenium-webdriver firefox content-security-policy selenium-firefoxdriver
1个回答
0
投票

更新firefox版本,测试v74.0正常工作

旧版本,请在centos 7中安装此版本

cd /usr/local
wget https://ftp.mozilla.org/pub/firefox/releases/74.0/linux-x86_64/zh-CN/firefox-74.0.tar.bz2
tar xvjf firefox-74.0.tar.bz2
yum -y install gtk3-devel
yum install libXt*
ln -s /usr/local/firefox/firefox /usr/bin/firefox
© www.soinside.com 2019 - 2024. All rights reserved.