Skip to content

Commit

Permalink
Make sure security headers are always set
Browse files Browse the repository at this point in the history
Closes #186
  • Loading branch information
LeoColomb committed Apr 13, 2020
1 parent 6862ac1 commit d84d94c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion h5bp/internet_explorer/x-ua-compatible.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
# https://msdn.microsoft.com/en-us/library/ff955275.aspx

<IfModule mod_headers.c>
Header set X-UA-Compatible "IE=edge" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
Header always set X-UA-Compatible "IE=edge" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
</IfModule>
2 changes: 1 addition & 1 deletion h5bp/security/content-security-policy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@

<IfModule mod_headers.c>
# (1) (2) (3) (4) (5) (6)
Header set Content-Security-Policy "default-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i"
Header always set Content-Security-Policy "default-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i"
</IfModule>
2 changes: 1 addition & 1 deletion h5bp/security/referrer-policy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@

<IfModule mod_headers.c>
# (1)
Header set Referrer-Policy "strict-origin-when-cross-origin" "expr=%{CONTENT_TYPE} =~ m#text\/(css|html|javascript)|application\/pdf|xml#i"
Header always set Referrer-Policy "strict-origin-when-cross-origin" "expr=%{CONTENT_TYPE} =~ m#text\/(css|html|javascript)|application\/pdf|xml#i"
</IfModule>
2 changes: 1 addition & 1 deletion h5bp/security/x-content-type-options.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# https://mimesniff.spec.whatwg.org/

<IfModule mod_headers.c>
Header set X-Content-Type-Options "nosniff"
Header always set X-Content-Type-Options "nosniff"
</IfModule>
2 changes: 1 addition & 1 deletion h5bp/security/x-frame-options.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
# https://www.owasp.org/index.php/Clickjacking

<IfModule mod_headers.c>
Header set X-Frame-Options "DENY" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
Header always set X-Frame-Options "DENY" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
</IfModule>
2 changes: 1 addition & 1 deletion h5bp/security/x-xss-protection.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@

<IfModule mod_headers.c>
# (1) (2)
Header set X-XSS-Protection "1; mode=block" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
Header always set X-XSS-Protection "1; mode=block" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
</IfModule>

0 comments on commit d84d94c

Please sign in to comment.