From 4eeed8cf12052e7fa5cbf4c1fcebd2a15db975d3 Mon Sep 17 00:00:00 2001 From: Abhishek Choudhary Date: Fri, 30 Aug 2024 09:19:21 +0545 Subject: [PATCH] only change conditionally --- src/resty/aws/request/build.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/resty/aws/request/build.lua b/src/resty/aws/request/build.lua index 9ce8851..810160b 100644 --- a/src/resty/aws/request/build.lua +++ b/src/resty/aws/request/build.lua @@ -106,7 +106,11 @@ local function build_request(operation, config, params) local body_tbl = {} if config.signingName or config.targetPrefix then - request.headers["X-Amz-Target"] = (config.targetPrefix or config.signingName) .. "." .. operation.name + if operation.name == "DetectToxicContent" then + request.headers["X-Amz-Target"] = (config.targetPrefix or config.signingName) .. "." .. operation.name + else + request.headers["X-Amz-Target"] = (config.signingName or config.targetPrefix) .. "." .. operation.name + end end if config.protocol == "query" then request.query["Action"] = operation.name