Fix query string detection
authorSteven Barth <steven@midlink.org>
Mon, 1 Jun 2009 18:30:41 +0000 (18:30 +0000)
committerSteven Barth <steven@midlink.org>
Mon, 1 Jun 2009 18:30:41 +0000 (18:30 +0000)
libs/lucid-http/luasrc/lucid/http/server.lua

index 70a17262186ad93330d1b5810fd9ea65fa37e2a8..67e917892ea9d243ffb55467e1601d2ac9c15f66 100644 (file)
@@ -343,13 +343,8 @@ function Server.parse_headers(self, source)
                        break
                end
        until false
-
-       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
-
+       
+       env.SCRIPT_NAME, env.QUERY_STRING = env.REQUEST_URI:match("([^?]*)%??(.*)")
        return req
 end