Knot Resolver 4.x.y (2019-0m-dd)
================================
+Improvements
+------------
+- DNS-over-HTTPS: answers include `access-control-allow-origin: *` (!823)
+
Bugfixes
--------
- TCP to upstream: don't send wrong message length (unlikely, !816)
entry = endpoints[path:match '^/[^/?]*']
end
-- Unpack MIME and data
- local data, mime, ttl, err
+ local data, mime, ttl, any_origin, err
if entry then
mime = entry[1]
data = entry[2]
ttl = entry[4]
+ any_origin = entry[5]
end
-- Get string data out of service endpoint
if type(data) == 'function' then
if ttl then
hsend:append('cache-control', string.format('max-age=%d', ttl))
end
+ if any_origin then
+ hsend:append('access-control-allow-origin', '*')
+ end
assert(stream:write_headers(hsend, false))
assert(stream:write_chunk(data, true))
end
-- Export endpoints
return {
endpoints = {
- ['/doh'] = {'text/plain', serve_doh},
+ ['/doh'] = {'text/plain', serve_doh, nil, nil, true},
}
}