Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] (Apache config) Headers *can* match based on Content-Type #2735

Open
Malvoz opened this issue Jul 25, 2019 · 0 comments
Open

[Docs] (Apache config) Headers *can* match based on Content-Type #2735

Malvoz opened this issue Jul 25, 2019 · 0 comments

Comments

@Malvoz
Copy link
Member

Malvoz commented Jul 25, 2019

no-html-only-headers states "Because mod_headers cannot match based on the content-type [...]", however this is untrue, using expr 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.

@Malvoz 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant