add htyroottoken

This commit is contained in:
moicen
2021-10-10 11:53:45 +08:00
parent c966f77142
commit 0d3d999230
+3 -1
View File
@@ -65,13 +65,15 @@ while true do
local remote_url = string.format("%s/api/v1/ts/create_task", task_server) local remote_url = string.format("%s/api/v1/ts/create_task", task_server)
ngx.log(ngx.INFO, 'remote_url -> ', remote_url) ngx.log(ngx.INFO, 'remote_url -> ', remote_url)
ngx.log(ngx.INFO, 'authorization -> ', ngx.req.get_headers().Authorization) ngx.log(ngx.INFO, 'authorization -> ', ngx.req.get_headers().Authorization)
ngx.log(ngx.INFO, 'htyroottoken -> ', ngx.req.get_headers().HtyRootToken)
local res, err = httpc:request_uri( local res, err = httpc:request_uri(
remote_url, remote_url,
{ {
method = "POST", method = "POST",
headers = { headers = {
["Content-Type"] = "application/json", ["Content-Type"] = "application/json",
["Authorization"] = ngx.req.get_headers().Authorization ["Authorization"] = ngx.req.get_headers().Authorization,
["HtyRootToken"] = ngx.req.get_headers().HtyRootToken
}, },
body = cjson.encode({task_type = TaskTypes.UPLOAD_PICTURE, data = {images = files}}), body = cjson.encode({task_type = TaskTypes.UPLOAD_PICTURE, data = {images = files}}),
} }