X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libs%2Flucid-http%2Fluasrc%2Flucid%2Fhttp%2Fserver.lua;h=67e917892ea9d243ffb55467e1601d2ac9c15f66;hb=8a3f3e860a7e0595007c344e0fdbbba334d2f404;hp=73239da1b2fd0cae3e6e86a033969e93855ce8f5;hpb=d2ce28a71edaafc540d12c9ccc648e4442fc82c2;p=oweals%2Fluci.git diff --git a/libs/lucid-http/luasrc/lucid/http/server.lua b/libs/lucid-http/luasrc/lucid/http/server.lua index 73239da1b..67e917892 100644 --- a/libs/lucid-http/luasrc/lucid/http/server.lua +++ b/libs/lucid-http/luasrc/lucid/http/server.lua @@ -344,7 +344,7 @@ function Server.parse_headers(self, source) end until false - env.SCRIPT_NAME, env.QUERY_STRING = env.REQUEST_URI:match("(.*)%??(.*)") + env.SCRIPT_NAME, env.QUERY_STRING = env.REQUEST_URI:match("([^?]*)%??(.*)") return req end @@ -358,8 +358,8 @@ function Server.process(self, client, env) local close = false local stat, code, msg, message, err - client:setsockopt("socket", "rcvtimeo", 15) - client:setsockopt("socket", "sndtimeo", 15) + client:setsockopt("socket", "rcvtimeo", 5) + client:setsockopt("socket", "sndtimeo", 5) repeat -- parse headers @@ -453,7 +453,7 @@ function Server.process(self, client, env) end end if not headers["Content-Length"] then - if message.http_version == 1.1 then + if message.env.SERVER_PROTOCOL == "HTTP/1.1" then headers["Transfer-Encoding"] = "chunked" sinkout = chunksink(client) else