Add additional CORS Headers

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/2/head
trivernis 4 years ago
parent 530458cfcd
commit 22183916c9
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

@ -90,7 +90,13 @@ impl UserHttpServer {
);
if dotenv::var(ENV_ENABLE_CORS).unwrap_or("false".to_string()) == "true" {
response = response.with_additional_header("Access-Control-Allow-Origin", "*");
response = response
.with_additional_header("Access-Control-Allow-Origin", "*")
.with_additional_header(
"Access-Control-Allow-Methods",
"GET,HEAD,PUT,PATCH,POST,DELETE",
)
.with_additional_header("Vary", "Access-Control-Request-Headers");
}
response

Loading…
Cancel
Save