]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
http: log requests in verbose mode
authorPetr Špaček <petr.spacek@nic.cz>
Tue, 31 Mar 2020 07:30:18 +0000 (09:30 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Thu, 2 Apr 2020 11:57:31 +0000 (13:57 +0200)
modules/http/http.lua.in

index fa54072e38c24d7d172e2e7afd2aecfbfaeeeee2..6a46ac73640bf0037962e43c01ebf76d4714dfac 100644 (file)
@@ -222,6 +222,10 @@ local function route(endpoints)
                local h = assert(stream:get_headers())
                local m = h:get(':method')
                local path = h:get(':path')
+               if verbose() then
+                       log('[http] %s %s HTTP/%d', m, path, connection.version)
+               end
+
                -- Upgrade connection to WebSocket
                local ws = http_websocket.new_from_stream(stream, h)
                if ws then