]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
modules/http: ignorring other GET parameters
authorIvana Krumlová <ivana.krumlova@nic.cz>
Thu, 20 Jun 2019 14:01:32 +0000 (16:01 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Tue, 25 Jun 2019 11:01:54 +0000 (11:01 +0000)
modules/http/http_doh.lua

index fb3f6bf67f944592adb692bde624080ff557cf4a..c57a413a172d0ef0722114619c5a7d50bb53d81d 100644 (file)
@@ -15,7 +15,10 @@ local function serve_doh(h, stream)
        if method == 'POST' then
                input = stream:get_body_chars(1025, 2)  -- read timeout = KR_CONN_RTT_MAX
        elseif method == 'GET' then
-               local input_b64 = string.match(h:get(':path'), '^/doh%?dns=([a-zA-Z0-9_-]+)$')
+               local input_b64 = string.match(h:get(':path'), '^/doh%?dns=([a-zA-Z0-9_-]+)$') or
+                               string.match(h:get(':path'), '^/doh%?dns=([a-zA-Z0-9_-]+)&') or
+                               string.match(h:get(':path'), '^/doh%?.*&dns=([a-zA-Z0-9_-]+)$') or
+                               string.match(h:get(':path'), '^/doh%?.*&dns=([a-zA-Z0-9_-]+)&')
                if not input_b64 then
                        return 400, 'base64url query not found'
                end