X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Flucid-http%2Fluasrc%2Flucid%2Fhttp%2Fserver.lua;h=7cfd1b70321087967ea9d13afa5ba8f9fb55072c;hp=21a752c68b8106b285cdcb14139d9220bc40900b;hb=0649e94571a72922682d1eeb03319d6ef6541fe4;hpb=693366bdd8cca7227976b3d3889bb0cf4dcfe9db diff --git a/libs/lucid-http/luasrc/lucid/http/server.lua b/libs/lucid-http/luasrc/lucid/http/server.lua index 21a752c68..7cfd1b703 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 @@ -432,6 +432,8 @@ function Server.process(self, client, env) else return self:error(client, 411, statusmsg[411]) end + + close = true else return self:error(client, 405, statusmsg[405]) end @@ -496,7 +498,9 @@ function Server.process(self, client, env) if sourceout and stat then if util.instanceof(sourceout, IOResource) then - stat, code, msg = sourceout.fd:copyz(client, sourceout.len) + -- Jow: copyz() oopses on brcm-2.4, use copy() for now + --stat, code, msg = sourceout.fd:copyz(client, sourceout.len) + stat, code, msg = sourceout.fd:copy(client, sourceout.len) else stat, msg = ltn12.pump.all(sourceout, sinkout) end