Skip to content

Commit 4f0df7c

Browse files
committed
Add the CDN to the whitelist in the content security policy
READMEs are not currently rendering in production right now because our CSP is disallowing requests to the recently-added CDN.
1 parent 93e9de4 commit 4f0df7c

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)