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 70a1726..67e9178 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