Change behaviour of Access-Control-Request-Headers

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/2/head
trivernis 4 years ago
parent 114f660707
commit 4b4aabd3e7
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -96,14 +96,14 @@ impl UserHttpServer {
"Access-Control-Allow-Methods", "Access-Control-Allow-Methods",
"GET,HEAD,PUT,PATCH,POST,DELETE", "GET,HEAD,PUT,PATCH,POST,DELETE",
) )
.with_additional_header("Vary", "Access-Control-Request-Headers") .with_additional_header("Vary", "Access-Control-Allow-Headers");
.with_additional_header(
"Access-Control-Request-Headers", if let Some(request_headers) = request.header("Access-Control-Request-Headers") {
request response = response.with_additional_header(
.header("Access-Control-Request-Headers") "Access-Control-Allow-Headers",
.unwrap_or("content-type") request_headers.to_string(),
.to_string(),
); );
}
} }
response response

Loading…
Cancel
Save