From 0f229b71b80258d78033f7266d38ae80060716af Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ivana=20Krumlov=C3=A1?= Date: Thu, 20 Jun 2019 16:01:32 +0200 Subject: [PATCH] modules/http: ignorring other GET parameters --- modules/http/http_doh.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.47.3