@@ -16,8 +16,7 @@ local VIA_HEADER = constants.HEADERS.VIA
16
16
local VIA_HEADER_VALUE = meta ._NAME .. " /" .. meta ._VERSION
17
17
18
18
local request_util = require " kong.plugins.aws-lambda.request-util"
19
- local AWS_Stream = require (" kong.plugins.aws-lambda.aws_stream" )
20
- local invokeWithResponseStream = require " kong.plugins.aws-lambda.execute"
19
+ local AWS_Stream = require (" resty.aws.stream" )
21
20
local build_request_payload = request_util .build_request_payload
22
21
local extract_proxy_response = request_util .extract_proxy_response
23
22
local remove_array_mt_for_empty_table = request_util .remove_array_mt_for_empty_table
@@ -170,7 +169,7 @@ local function invoke_streaming(conf, lambda_service)
170
169
-- TRACING: set KONG_WAITING_TIME start
171
170
local kong_wait_time_start = get_now ()
172
171
173
- local res , err = invokeWithResponseStream (lambda_service , {
172
+ local res , err = lambda_service : invokeWithResponseStream ({
174
173
FunctionName = conf .function_name ,
175
174
InvocationType = conf .invocation_type ,
176
175
LogType = conf .log_type ,
@@ -263,12 +262,10 @@ local function invoke_streaming(conf, lambda_service)
263
262
end
264
263
265
264
-- print(require("pl.pretty").write(msg))
266
- for _ , header in ipairs (msg .headers ) do
267
- if header .key == " :event-type" and header .value == " PayloadChunk" then
268
- -- print(msg.body)
269
- ngx .print (msg .body )
270
- ngx .flush (true )
271
- end
265
+ if msg .headers [" :event-type" ] == " PayloadChunk" then
266
+ -- print(msg.body)
267
+ ngx .print (msg .body )
268
+ ngx .flush (true )
272
269
end
273
270
end
274
271
end
0 commit comments