Browse Source

[YQTemplate] №3: Fix some more

main
Annwan 4 months ago
parent
commit
1bc217e134
  1. 4
      utils.lua

4
utils.lua

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

Loading…
Cancel
Save