Fix HTTP: Use permissive CORS headers for .well-known endpoints

This commit is contained in:
Maurus Decimus
2026-05-08 08:06:18 +02:00
parent 52f366454b
commit af583c19c1
6 changed files with 26 additions and 7 deletions

View File

@@ -456,6 +456,7 @@ impl OAuthApiHandler for Server {
code_challenge_methods_supported: &["S256"],
issuer: base_url.to_string(),
})
.into_http_response())
.into_http_response()
.with_cors_unrestricted())
}
}

View File

@@ -99,6 +99,7 @@ impl OpenIdHandler for Server {
code_challenge_methods_supported: &["S256"],
issuer: base_url.to_string(),
})
.into_http_response())
.into_http_response()
.with_cors_unrestricted())
}
}

View File

@@ -321,7 +321,8 @@ impl ParseHttp for Server {
.await?
.into_bytes(),
)
.into_http_response());
.into_http_response()
.with_cors_unrestricted());
}
("mail-v1.xml", &Method::GET) => {
// Limit anonymous requests
@@ -344,10 +345,10 @@ impl ParseHttp for Server {
return self
.handle_autoconfig_request(req.uri().query())
.await
.map(|resource| resource.into_http_response());
.map(|resource| resource.into_http_response().with_cors_unrestricted());
}
(_, &Method::OPTIONS) => {
return Ok(HttpResponse::new(StatusCode::NO_CONTENT));
return Ok(HttpResponse::new(StatusCode::NO_CONTENT).with_cors_unrestricted());
}
_ => (),
},