Fixed HTTP stack to parse urlencoded data from Internet Explorer correctly
authorSteven Barth <steven@midlink.org>
Fri, 5 Sep 2008 11:36:53 +0000 (11:36 +0000)
committerSteven Barth <steven@midlink.org>
Fri, 5 Sep 2008 11:36:53 +0000 (11:36 +0000)
Internet Explorer appends a whitespace character after the last parameter which will now be stripped

libs/http/luasrc/http/protocol.lua

index fd0a046..93c9e79 100644 (file)
@@ -500,7 +500,7 @@ function urldecode_message_body( src, msg )
                                if spos then
                                        local pair = data:sub( spos, epos - 1 )
                                        local key  = pair:match("^(.-)=")
-                                       local val  = pair:match("=(.*)$")
+                                       local val  = pair:match("=([^%s]*)%s*$")
 
                                        if key and #key > 0 then
                                                __initval( msg.params, key )