diff --git a/utils.lua b/utils.lua index 0884aee..3f2742a 100644 --- a/utils.lua +++ b/utils.lua @@ -87,14 +87,14 @@ _m.parse_form_entry = function(entry) break elseif entry:sub(cursor, cursor+18) == 'Content-Disposition' then cursor = cursor + 38 - name = string.match(entry, "(.*)\"", cursor) + name = string.match(entry:sub(cursor), "^(.-)\"") cursor = cursor + #name + 1 --[[ the closing quote ]] -- Find the end of line while entry:sub(cursor, cursor) ~= "\r" do cursor = cursor + 1 end cursor = cursor + 2 elseif entry:sub(cursor, cursor+11) == 'Content-Type' then cursor = cursor + 14 - ctype = string.match(entry, "(.*)\r", cursor) + ctype = string.match(entry:sub(cursor), "^(.-)\r") cursor = cursor + #ctype while entry:sub(cursor, cursor) ~= "\r" do cursor = cursor + 1 end cursor = cursor + 2 --[[ CRLF ]]