Skip to content

Commit 728f1d2

Browse files
committed
Move static HTTP response headers to nginx.conf
We'd like to have these headers on the FastBoot server as well.
1 parent 373ae24 commit 728f1d2

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

config/nginx.conf.erb

+4
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ http {
121121
expires max;
122122
}
123123

124+
add_header X-Content-Type-Options "no-sniff";
125+
add_header X-Frame-Options "SAMEORIGIN";
126+
add_header X-XSS-Protection "1; mode=block";
127+
124128
add_header Strict-Transport-Security "max-age=31536000" always;
125129
add_header Vary 'Accept, Accept-Encoding, Cookie';
126130
proxy_set_header Host $http_host;

src/middleware/security_headers.rs

-6
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ impl SecurityHeaders {
1313
pub fn new(uploader: &Uploader) -> Self {
1414
let mut headers = HashMap::new();
1515

16-
headers.insert("X-Content-Type-Options".into(), vec!["nosniff".into()]);
17-
18-
headers.insert("X-Frame-Options".into(), vec!["SAMEORIGIN".into()]);
19-
20-
headers.insert("X-XSS-Protection".into(), vec!["1; mode=block".into()]);
21-
2216
let s3_host = match *uploader {
2317
Uploader::S3 {
2418
ref bucket,

0 commit comments

Comments
 (0)