mirror of
https://forgejo.ellis.link/continuwuation/continuwuity/
synced 2026-08-28 13:14:05 +00:00
web::login: add form-data CSP rules for localhost
This commit is contained in:
@@ -24,10 +24,12 @@ pub struct OidcResponse {
|
||||
|
||||
impl IntoResponse for OidcResponse {
|
||||
fn into_response(self) -> Response<Body> {
|
||||
let content_csp = match self.nonce {
|
||||
| Some(nonce) => &format!("default-src 'nonce-{nonce}'; form-action 'self';"),
|
||||
| None => "default-src 'none'; form-action 'self';",
|
||||
let csp_src = match self.nonce {
|
||||
| Some(nonce) => &format!("default-src 'nonce-{nonce}';"),
|
||||
| None => "default-src 'none';",
|
||||
};
|
||||
let csp_form_action = "form-action 'self' http://localhost http://127.0.0.1 http://[::1];";
|
||||
let content_csp = format!("{csp_src} {csp_form_action}");
|
||||
let content_type = match self.body {
|
||||
| Some(OAuthRequestBody::Json(_)) => "application/json",
|
||||
| _ => "text/html",
|
||||
|
||||
Reference in New Issue
Block a user