We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7939aca commit 666cb2fCopy full SHA for 666cb2f
src/web/csp.rs
@@ -8,8 +8,11 @@ pub(super) struct Csp {
8
9
impl Csp {
10
fn new() -> Self {
11
+ // Nonces need to be different for each single request in order to maintain security, so we
12
+ // generate a new one with a cryptographically-secure generator for each request.
13
let mut random = [0u8; 36];
14
getrandom::getrandom(&mut random).expect("failed to generate a nonce");
15
+
16
Self {
17
nonce: base64::encode(&random),
18
suppress: false,
0 commit comments