The Content-Security-Policy header must not be overridden
https://github.com/apache/arrow-site/blob/0a7594a059837f9324ee769fa29c5e84d6103156/.htaccess#L31
The Content-Security-Policy header must not be overridden.
There is now a standard way to add local exceptions to the CSP:
https://infra.apache.org/tools/csp.html
Please update the .htaccess file accordingly.
Thanks @sebbASF. @thisisnic are you able to take a look at this?
Thanks for the ping @amoeba, will take a look next week.
Please note that the policy says that any exceptions must have been approved, and a reference to the approval must be commented in the .htaccess file
Thanks for the info @sebbASF. I was wondering if you know of other projects which are using the kapa.ai bot which have needed to do the same, so I can compare to those and check if it looks right before I merge? Last time we updated the .htaccess file, it took a lot of rounds to get it right while trying not to take out the website for too long.
Which pages have the kapa.ai bot? I could not find any reference to it except in the htaccess CSP override.
Note that there are ways to test changes to the CSP without affecting the deployed site. You could set up a preview site (define this in .asf.yaml).
Or the Attic project has a Docker definition that can apply any desired CSP to a remote website. Details are in https://github.com/apache/attic/blob/main/DOCKER.md
The basic commands are:
$ docker compose build
(only needs to be done once, unless you change any files)
VAR_HOSTURL=https://beam.apache.org/ CSP_PROJECT_DOMAINS="host1 host2" docker compose up
Navigate to localhost:8000
If you enable browser debugging, you should be able to see if there are any CSP errors in the console log.