Skip to content

Commit d84d94c

Browse files
committed
Make sure security headers are always set
Closes #186
1 parent 6862ac1 commit d84d94c

6 files changed

+6
-6
lines changed

h5bp/internet_explorer/x-ua-compatible.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
# https://msdn.microsoft.com/en-us/library/ff955275.aspx
1818

1919
<IfModule mod_headers.c>
20-
Header set X-UA-Compatible "IE=edge" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
20+
Header always set X-UA-Compatible "IE=edge" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
2121
</IfModule>

h5bp/security/content-security-policy.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,5 @@
7575

7676
<IfModule mod_headers.c>
7777
# (1) (2) (3) (4) (5) (6)
78-
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"
78+
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"
7979
</IfModule>

h5bp/security/referrer-policy.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222

2323
<IfModule mod_headers.c>
2424
# (1)
25-
Header set Referrer-Policy "strict-origin-when-cross-origin" "expr=%{CONTENT_TYPE} =~ m#text\/(css|html|javascript)|application\/pdf|xml#i"
25+
Header always set Referrer-Policy "strict-origin-when-cross-origin" "expr=%{CONTENT_TYPE} =~ m#text\/(css|html|javascript)|application\/pdf|xml#i"
2626
</IfModule>

h5bp/security/x-content-type-options.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
# https://mimesniff.spec.whatwg.org/
1515

1616
<IfModule mod_headers.c>
17-
Header set X-Content-Type-Options "nosniff"
17+
Header always set X-Content-Type-Options "nosniff"
1818
</IfModule>

h5bp/security/x-frame-options.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@
3333
# https://www.owasp.org/index.php/Clickjacking
3434

3535
<IfModule mod_headers.c>
36-
Header set X-Frame-Options "DENY" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
36+
Header always set X-Frame-Options "DENY" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
3737
</IfModule>

h5bp/security/x-xss-protection.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@
3737

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

0 commit comments

Comments
 (0)