Add Access-Control-Allow-Origin header for /.well-known/ directory

This commit is contained in:
2021-05-09 12:25:39 +02:00
parent 30b163c6fa
commit 0b157bcb74

View File

@ -219,6 +219,10 @@ int client_request_handler(sock *client, unsigned long client_num, unsigned int
goto respond; goto respond;
} }
if (strncmp(uri.req_path, "/.well-known/", 13) == 0) {
http_add_header_field(&res.hdr, "Access-Control-Allow-Origin", "*");
}
if (strncmp(uri.req_path, "/.well-known/", 13) != 0 && strstr(uri.path, "/.") != NULL) { if (strncmp(uri.req_path, "/.well-known/", 13) != 0 && strstr(uri.path, "/.") != NULL) {
res.status = http_get_status(403); res.status = http_get_status(403);
sprintf(err_msg, "Parts of this URI are hidden."); sprintf(err_msg, "Parts of this URI are hidden.");