diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-06-01 18:10:37 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-06-01 18:10:37 +0000 |
commit | 217af86e3560b585524481e6d98b94b6dfe6a7f3 (patch) | |
tree | dcf814dfc1d24b057806a50d02f81e91fcd274c0 /libs/lucid-http | |
parent | 6a2bb359fdb3bb6a2a2545f46d70e83d608ca49b (diff) |
lucid: fix separation of query string and url in server handler
Diffstat (limited to 'libs/lucid-http')
-rw-r--r-- | libs/lucid-http/luasrc/lucid/http/server.lua | 9 |
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 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 |