You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Malvoz
changed the title
[Docs] Headers *can* match based on Content-Type
[Docs] (Apache config) Headers *can* match based on Content-Type
Jul 30, 2019
no-html-only-headers
states "Becausemod_headers
cannot match based on the content-type [...]", however this is untrue, usingexpr
in apache 2.4.10 and later.Here's one example method:
Header set X-Header "Value" "expr=%{CONTENT_TYPE} =~ m#{MIME-Type}#i"
and I believe to match multiple types you'd do:
expr=%{CONTENT_TYPE} =~ m#text/html|application/pdf|{etc...}#i
FWIW, H5BP switched to using
expr
from<FilesMatch>
in their snippets.The text was updated successfully, but these errors were encountered: