libs/http: Added handling of "+" in luci.http.protocl.urldecode
[project/luci.git] / libs / http / luasrc / http / protocol.lua
index 93851fb..a187bed 100644 (file)
@@ -30,6 +30,7 @@ function urldecode( str )
        end
 
        if type(str) == "string" then
+               str = str:gsub( "+", " " )
                str = str:gsub( "%%([a-fA-F0-9][a-fA-F0-9])", __chrdec )
        end
 
@@ -535,7 +536,7 @@ function header_source( sock )
                if chunk == nil then
                        if err ~= "timeout" then
                                return nil, part
-                                       and "Line exceeds maximum allowed length["..part.."]"
+                                       and "Line exceeds maximum allowed length"
                                        or  "Unexpected EOF"
                        else
                                return nil, err