]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
doh2: fix CORS by adding `access-control-allow-origin: *`
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 10 Jan 2022 17:07:44 +0000 (18:07 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 10 Jan 2022 17:28:40 +0000 (18:28 +0100)
For old doh we added this in commit a34aa1ee743;
with the new implementation we somehow forgot.

NEWS
daemon/http.c

diff --git a/NEWS b/NEWS
index c31550a6e8111f96520032eade1c28f701862bc3..89d8aa96ed6d3f33dc2e39e5a0fd181f095c36dd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,10 @@ Incompatible changes
 --------------------
 - libknot >= 3.0.2 is required
 
+Bugfixes
+--------
+- doh2: fix CORS by adding `access-control-allow-origin: *` (!1246)
+
 
 Knot Resolver 5.4.4 (2022-01-05)
 ================================
index f340d86a5fa7a3d2c08d4a7e5bb1e8f9eca91bcf..0f9551d287e8491690828cd2484a6043ddc174de 100644 (file)
@@ -695,6 +695,7 @@ static int http_send_response(struct http_ctx *ctx, int32_t stream_id,
        nghttp2_nv hdrs[] = {
                MAKE_STATIC_NV(":status", "200"),
                MAKE_STATIC_NV("content-type", "application/dns-message"),
+               MAKE_STATIC_NV("access-control-allow-origin", "*"),
                MAKE_NV("content-length", 14, size, size_len),
                MAKE_NV("cache-control", 13, max_age, max_age_len),
        };