Index: http.lua =================================================================== --- http.lua (revision 78) +++ http.lua (working copy) @@ -433,7 +433,10 @@ content = string.sub(content, 1, string.len(content)-1) elseif postdata and type(postdata) == "string" then content = postdata - content = string.gsub(content, " ","+") + if not options['header']['Content-Type'] or + options['header']['Content-Type'] == "application/x-www-form-urlencoded" then + content = string.gsub(content, " ","+") + end end local mod_options = { @@ -1081,6 +1084,12 @@ if type(response) ~= "string" then return response end local result = {status=nil,["status-line"]=nil,header={},rawheader={},body=""} + -- if we have a 100 Continue, we need to chop it of + -- or else the next separation will endup with the next pair of headers + if response and response:match("^HTTP/1.1 100 Continue") and response:match( "\r?\n\r?\n" ) then + response = response:match( "\r?\n\r?\n(.*)$" ) + end + -- try and separate the head from the body local header, body if response and response:match( "\r?\n\r?\n" ) then