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

@@ -179,6 +179,21 @@ impl HttpResponse {
self
}
pub fn with_cors_unrestricted(mut self) -> Self {
self.builder = self
.builder
.header(header::ACCESS_CONTROL_ALLOW_ORIGIN, "*")
.header(
header::ACCESS_CONTROL_ALLOW_HEADERS,
"Authorization, Content-Type, Accept, X-Requested-With",
)
.header(
header::ACCESS_CONTROL_ALLOW_METHODS,
"POST, GET, PATCH, PUT, DELETE, HEAD, OPTIONS",
);
self
}
pub fn size(&self) -> usize {
match &self.body {
HttpResponseBody::Text(value) => value.len(),