From 55543fd31abd768b5b9565936e9f45f61db8add3 Mon Sep 17 00:00:00 2001 From: attenuation Date: Wed, 6 Jul 2022 15:43:16 +0800 Subject: [PATCH] fix(aws-lambda) change path from request_uri to upstream_uri --- kong/plugins/aws-lambda/aws-serializer.lua | 2 +- spec/03-plugins/27-aws-lambda/05-aws-serializer_spec.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kong/plugins/aws-lambda/aws-serializer.lua b/kong/plugins/aws-lambda/aws-serializer.lua index d6458e154296..e03349c6262d 100644 --- a/kong/plugins/aws-lambda/aws-serializer.lua +++ b/kong/plugins/aws-lambda/aws-serializer.lua @@ -78,7 +78,7 @@ return function(ctx, config) end -- prepare path - local path = var.request_uri:match("^([^%?]+)") -- strip any query args + local path = var.upstream_uri:match("^([^%?]+)") -- strip any query args local request = { resource = ctx.router_matches.uri, diff --git a/spec/03-plugins/27-aws-lambda/05-aws-serializer_spec.lua b/spec/03-plugins/27-aws-lambda/05-aws-serializer_spec.lua index 72d19c94b773..3ece2554b9bc 100644 --- a/spec/03-plugins/27-aws-lambda/05-aws-serializer_spec.lua +++ b/spec/03-plugins/27-aws-lambda/05-aws-serializer_spec.lua @@ -53,7 +53,7 @@ describe("[AWS Lambda] aws-gateway input", function() body = "text", var = { request_method = "GET", - request_uri = "/123/strip/more?boolean=;multi-query=first;single-query=hello%20world;multi-query=second" + upstream_uri = "/123/strip/more?boolean=;multi-query=first;single-query=hello%20world;multi-query=second" }, ctx = { router_matches = { @@ -113,7 +113,7 @@ describe("[AWS Lambda] aws-gateway input", function() body = "text", var = { request_method = "GET", - request_uri = "/plain/strip/more?boolean=;multi-query=first;single-query=hello%20world;multi-query=second" + upstream_uri = "/plain/strip/more?boolean=;multi-query=first;single-query=hello%20world;multi-query=second" }, ctx = { router_matches = { @@ -187,7 +187,7 @@ describe("[AWS Lambda] aws-gateway input", function() query = {}, var = { request_method = "GET", - request_uri = "/plain/strip/more", + upstream_uri = "/plain/strip/more", http_content_type = tdata.ct, }, ctx = {