]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
doh2 tests: check CORS headers
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 10 Jan 2022 17:16:04 +0000 (18:16 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 10 Jan 2022 17:28:43 +0000 (18:28 +0100)
I didn't feel like adding it to every test, so I picked a mix.
I confirmed this would fail before the parent commit.

tests/config/doh2.test.lua

index ef43256335ea03e5ff5b3855a724b8f3468c80f5..429963c9a7ee6373c174388a92d5c53c4be669fd 100644 (file)
@@ -117,6 +117,7 @@ else
                end
                -- uncacheable
                same(headers:get('cache-control'), 'max-age=0', desc .. ': TTL 0')
+               same(headers:get('access-control-allow-origin'), '*', desc .. ': CORS headers')
                same(pkt:rcode(), kres.rcode.SERVFAIL, desc .. ': rcode matches')
        end
 
@@ -225,6 +226,7 @@ else
                end
                -- HTTP TTL is minimum from all RRs in the answer
                same(headers:get('cache-control'), 'max-age=300', desc .. ': TTL 900')
+               same(headers:get('access-control-allow-origin'), '*', desc .. ': CORS headers')
                same(pkt:rcode(), kres.rcode.NOERROR, desc .. ': rcode matches')
                same(pkt:ancount(), 3, desc .. ': ANSWER is present')
                same(pkt:nscount(), 1, desc .. ': AUTHORITY is present')