From: Jo-Philipp Wich Date: Mon, 1 Jun 2009 18:10:37 +0000 (+0000) Subject: lucid: fix separation of query string and url in server handler X-Git-Tag: 0.9.0~274 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=217af86e3560b585524481e6d98b94b6dfe6a7f3 lucid: fix separation of query string and url in server handler --- diff --git a/libs/lucid-http/luasrc/lucid/http/server.lua b/libs/lucid-http/luasrc/lucid/http/server.lua index 21a752c68..70a172621 100644 --- a/libs/lucid-http/luasrc/lucid/http/server.lua +++ b/libs/lucid-http/luasrc/lucid/http/server.lua @@ -343,8 +343,13 @@ function Server.parse_headers(self, source) break end until false - - env.SCRIPT_NAME, env.QUERY_STRING = env.REQUEST_URI:match("(.*)%??(.*)") + + if env.REQUEST_URI:find("?") then + env.SCRIPT_NAME, env.QUERY_STRING = env.REQUEST_URI:match("([^%?]*)%?(.*)") + else + env.SCRIPT_NAME, env.QUERY_STRING = env.REQUEST_URI, nil + end + return req end