summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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 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