From 1bc217e134297e913faa03be020ff958569fc329 Mon Sep 17 00:00:00 2001 From: Annwan Date: Thu, 15 Aug 2024 03:04:23 +0200 Subject: [PATCH] =?UTF-8?q?[YQTemplate]=20=E2=84=963:=20Fix=20some=20more?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ]]