disable auth check

This commit is contained in:
2021-11-28 10:40:18 +08:00
parent 5a81e9e3c1
commit fc51ac41f8
+28 -26
View File
@@ -111,37 +111,39 @@ function decodeJwtToken(encrypted_token)
end
while true do
local typ, res, err = form:read()
local type, res, err = form:read()
if not typ then
if not type then
ngx.say("FAILED TO READ *UPLOAD IMAGE* -> ", err)
return
end
local authHeader = ngx.req.get_headers().Authorization
if authHeader then
ngx.log(ngx.INFO, 'Check request authorization Authorization -> ', authHeader)
-- local htytoken = DecoderJwtToken(authorization)
--verifyJwtToken(authHeader)
else
ngx.log(ngx.ERR, 'Request header no authorization ! ')
ngx.status = 500
ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
end
--
--if authHeader then
-- ngx.log(ngx.INFO, 'Check request authorization Authorization -> ', authHeader)
-- -- local htytoken = DecoderJwtToken(authorization)
-- --verifyJwtToken(authHeader)
--else
-- ngx.log(ngx.ERR, 'Request header no authorization ! ')
-- ngx.status = 500
-- ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
--end
local sudoerToken = ngx.req.get_headers().HtySudoerToken
if sudoerToken then
ngx.log(ngx.INFO, 'Check request authorization HtySudoerToken -> ', sudoerToken)
-- local htytoken = DecoderJwtToken(authorization)
--verifyJwtToken(sudoerToken)
--local sudoerToken = ngx.req.get_headers().HtySudoerToken
--
--if sudoerToken then
-- ngx.log(ngx.INFO, 'Check request authorization HtySudoerToken -> ', sudoerToken)
-- -- local htytoken = DecoderJwtToken(authorization)
-- --verifyJwtToken(sudoerToken)
--
--else
-- ngx.log(ngx.ERR, 'Request header no hty sudoer token ! ')
-- ngx.status = 500
-- ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
--end
else
ngx.log(ngx.ERR, 'Request header no hty sudoer token ! ')
ngx.status = 500
ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)
end
if typ == "header" then
if type == "header" then
--"Content-Disposition","form-data; name=\"files[]\"; filename=\"Song-of-joy.png\""
--"Content-Type","image\/png"
@@ -161,12 +163,12 @@ while true do
end
end
elseif typ == "body" then
elseif type == "body" then
if file then
file:write(res)
-- sha1:update(res)
end
elseif typ == "part_end" then
elseif type == "part_end" then
if file then
file:close()
table.insert(files, file_name)
@@ -175,7 +177,7 @@ while true do
-- file:flush() 和 io.flush() 都没效果
file_name = nil
file = nil
elseif typ == "eof" then
elseif type == "eof" then
local remote_url = string.format("%s/api/v1/ts/create_task", task_server)