summaryrefslogtreecommitdiffhomepage
path: root/libs/lucid-http/luasrc/lucid/http
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-06-01 18:10:37 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-06-01 18:10:37 +0000
commit217af86e3560b585524481e6d98b94b6dfe6a7f3 (patch)
treedcf814dfc1d24b057806a50d02f81e91fcd274c0 /libs/lucid-http/luasrc/lucid/http
parent6a2bb359fdb3bb6a2a2545f46d70e83d608ca49b (diff)
lucid: fix separation of query string and url in server handler
Diffstat (limited to 'libs/lucid-http/luasrc/lucid/http')
-rw-r--r--libs/lucid-http/luasrc/lucid/http/server.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/lucid-http/luasrc/lucid/http/server.lua b/libs/lucid-http/luasrc/lucid/http/server.lua
index 21a752c68b..70a1726218 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