0

I know that I can add a header if its missing, using the setifempty like:
Header always setifempty Content-Security-Policy-Report-Only "foobar"

But how do I set a header only when another header is missing, like I want to set the "Content-Security-Policy-Report-Only" only if there is no "Content-Security-Policy" header.

Tried to use SetEnvIf like:

SetEnvIf Content-Security-Policy "^$" no_csp_header
Header always setifempty Content-Security-Policy-Report-Only "foobar" env=no_csp_header

But I got a response with both headers, so it didn't work.

  • Probably your web application should set these headers. – Michael Hampton Feb 19 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.