From 0b157bcb740bb290ce1035989aacc777e3c73a75 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Sun, 9 May 2021 12:25:39 +0200 Subject: [PATCH] Add Access-Control-Allow-Origin header for /.well-known/ directory --- src/client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client.c b/src/client.c index ea542cc..99bf9db 100644 --- a/src/client.c +++ b/src/client.c @@ -219,6 +219,10 @@ int client_request_handler(sock *client, unsigned long client_num, unsigned int 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) { res.status = http_get_status(403); sprintf(err_msg, "Parts of this URI are hidden.");