centos 中的 firefox set csp header 无效

firefox in centos set csp header not effective

我尝试加入 csp header 以响应 firefox 通过代理访问的每个请求,但没有 csp 报告发送,并尝试在 mac firefox 中做同样的事情(相同代码),程序运行没有问题,我收到csp报告,所以我认为这可能是centos中firefox的问题

这是我的环境,通过yum安装firefox,代码使用selenium运行firefox,使用browsermob添加csp header响应,代码结果csp header已经添加响应,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 规则

有什么办法可以解决这个问题

更新firefox版本,测试v74.0运行良好

yum版本老了,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