Skip to content

Commit f362f3d

Browse files
committed
optimize: use the $http_content_type variable instead of ngx.req.get_headers()["content-type"]. thanks Soojin Nam for the patch in openresty#15.
1 parent af165dd commit f362f3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/resty/upload.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ local match = string.match
77
local setmetatable = setmetatable
88
local get_headers = ngx.req.get_headers
99
local type = type
10+
local ngx_var = ngx.var
1011
-- local print = print
1112

1213

@@ -27,7 +28,7 @@ local state_handlers
2728

2829

2930
local function get_boundary()
30-
local header = get_headers()["content-type"]
31+
local header = ngx_var.content_type
3132
if not header then
3233
return nil
3334
end

0 commit comments

Comments
 (0)