Skip to content

Commit 3cba145

Browse files
committed
Leave a note about why we need unsafe-eval for now
Always leave a note.
1 parent 93ad0d8 commit 3cba145

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/http.rs

+5
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ impl Middleware for SecurityHeadersMiddleware {
101101
mut res: Result<Response, Box<Error + Send>>,
102102
) -> Result<Response, Box<Error + Send>> {
103103
if let Ok(ref mut response) = res {
104+
// It would be better if we didn't have to have 'unsafe-eval' in the `script-src`
105+
// policy, but google charts (used for the download graph on crate pages) uses `eval`
106+
// to load scripts. Remove 'unsafe-eval' if google fixes the issue:
107+
// https://github.com/google/google-visualization-issues/issues/1356
108+
// or if we switch to a different graph generation library.
104109
response.headers.insert(
105110
"Content-Security-Policy".into(),
106111
vec![

0 commit comments

Comments
 (0)