From 217af86e3560b585524481e6d98b94b6dfe6a7f3 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 1 Jun 2009 18:10:37 +0000 Subject: lucid: fix separation of query string and url in server handler --- libs/lucid-http/luasrc/lucid/http/server.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libs/lucid-http/luasrc') 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 -- cgit v1.2.3