There was an error while loading. Please reload this page.
1 parent 5b86429 commit d0a4906Copy full SHA for d0a4906
lib/resty/upload.lua
@@ -11,7 +11,9 @@ local STATE_READING_HEADER = 2
11
local STATE_READING_BODY = 3
12
local STATE_EOF = 4
13
14
-local mt = { __index = resty.upload }
+local class = resty.upload
15
+
16
+local mt = { __index = class }
17
18
local sub = string.sub
19
local req_socket = ngx.req.socket
@@ -248,7 +250,7 @@ state_handlers = {
248
250
249
251
252
-- to prevent use of casual module global variables
-getmetatable(resty.upload).__newindex = function (table, key, val)
253
+getmetatable(class).__newindex = function (table, key, val)
254
error('attempt to write to undeclared variable "' .. key .. '": '
255
.. debug.traceback())
256
end
0 commit comments