mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-13 20:26:52 +00:00
feat: Add support for registering accounts with the web UI
This commit is contained in:
25 files changed
+1275
-508
No files matched your search
@@ -49,11 +49,17 @@ pub(super) async fn template_context_middleware(
|
||||
|
||||
let mut response = next.run(request).await;
|
||||
|
||||
let child_src = if config.recaptcha_site_key.is_some() {
|
||||
"www.google.com"
|
||||
} else {
|
||||
"'none'"
|
||||
};
|
||||
|
||||
response.headers_mut().insert(
|
||||
header::CONTENT_SECURITY_POLICY,
|
||||
HeaderValue::from_str(&format!(
|
||||
"default-src 'none'; style-src 'self'; img-src 'self' 'https' data:; script-src \
|
||||
'nonce-{csp_nonce}';"
|
||||
'nonce-{csp_nonce}'; child-src {child_src};"
|
||||
))
|
||||
.expect("should be able to build CSP header"),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user