Skip to content

Commit 4f3fd0f

Browse files
committed
improve: removed the superfluous header type check
The ngx.var API only returns a Lua string in case of success or `nil` if failure. So check whether the header is a Lua table is superfluous.
1 parent 8f4f0f8 commit 4f3fd0f

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

lib/resty/upload.lua

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
local req_socket = ngx.req.socket
66
local match = string.match
77
local setmetatable = setmetatable
8-
local type = type
98
local ngx_var = ngx.var
109
-- local print = print
1110

@@ -33,10 +32,6 @@ local function get_boundary()
3332
return nil
3433
end
3534

36-
if type(header) == "table" then
37-
header = header[1]
38-
end
39-
4035
local m = match(header, ";%s*boundary=\"([^\"]+)\"")
4136
if m then
4237
return m

0 commit comments

Comments
 (0)