Skip to content

Commit e8cae0e

Browse files
Merge #1166
1166: Add the CDN to the whitelist in the content security policy r=carols10cents READMEs are not currently rendering in production right now because our CSP is disallowing requests to the recently-added CDN. I'm going to deploy this when tests pass bc production is broken right now.
2 parents 93e9de4 + 4f0df7c commit e8cae0e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/http.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,14 @@ impl SecurityHeadersMiddleware {
2525
headers.insert("X-XSS-Protection".into(), vec!["1; mode=block".into()]);
2626

2727
let s3_host = match *uploader {
28-
Uploader::S3 { ref bucket, .. } => bucket.host(),
28+
Uploader::S3 {
29+
ref bucket,
30+
ref cdn,
31+
..
32+
} => match *cdn {
33+
Some(ref s) => s.clone(),
34+
None => bucket.host(),
35+
},
2936
_ => unreachable!(
3037
"This middleware should only be used in the production environment, \
3138
which should also require an S3 uploader, QED"

0 commit comments

Comments
 (0)