]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
doh: fix error handling around empty POST
authorPetr Špaček <petr.spacek@nic.cz>
Tue, 9 Apr 2019 11:20:02 +0000 (13:20 +0200)
committerPetr Špaček <petr.spacek@nic.cz>
Thu, 11 Apr 2019 07:12:50 +0000 (09:12 +0200)
modules/http/http_doh.lua

index 8091250a0faedfdaca050834ec01320ce6dbf18e..71d1836768bf5e68000cc8b64b399aaafc8ea40f 100644 (file)
@@ -30,7 +30,7 @@ local function serve_doh(h, stream)
                return 405, 'only HTTP POST and GET are supported'
        end
 
-       if #input < 12 then
+       if not input or #input < 12 then
                return 400, 'input too short'
        elseif #input > 1024 then
                return 413, 'input too long'