From: Ivana Krumlová Date: Thu, 20 Jun 2019 14:01:32 +0000 (+0200) Subject: modules/http: ignorring other GET parameters X-Git-Tag: v4.1.0~15^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f229b71b80258d78033f7266d38ae80060716af;p=thirdparty%2Fknot-resolver.git modules/http: ignorring other GET parameters --- diff --git a/modules/http/http_doh.lua b/modules/http/http_doh.lua index fb3f6bf67..c57a413a1 100644 --- a/modules/http/http_doh.lua +++ b/modules/http/http_doh.lua @@ -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