From 4f3fd0f8dd228fe7211dbaf9e4a76f8b279a1d3e Mon Sep 17 00:00:00 2001 From: tokers Date: Sun, 17 Feb 2019 17:48:47 +0800 Subject: [PATCH] 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. --- lib/resty/upload.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/resty/upload.lua b/lib/resty/upload.lua index 37da961..66dae98 100644 --- a/lib/resty/upload.lua +++ b/lib/resty/upload.lua @@ -5,7 +5,6 @@ local req_socket = ngx.req.socket local match = string.match local setmetatable = setmetatable -local type = type local ngx_var = ngx.var -- local print = print @@ -33,10 +32,6 @@ local function get_boundary() return nil end - if type(header) == "table" then - header = header[1] - end - local m = match(header, ";%s*boundary=\"([^\"]+)\"") if m then return m