From e61d4b6e7a2e48c2fc5de158ed5f94e16fd6be7c Mon Sep 17 00:00:00 2001 From: DanielRailean Date: Thu, 29 Feb 2024 14:46:19 +0100 Subject: [PATCH] Update sigv4.lua --- kong/plugins/aws-request-signing/sigv4.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kong/plugins/aws-request-signing/sigv4.lua b/kong/plugins/aws-request-signing/sigv4.lua index 489732e..904df88 100644 --- a/kong/plugins/aws-request-signing/sigv4.lua +++ b/kong/plugins/aws-request-signing/sigv4.lua @@ -212,15 +212,15 @@ local function prepare_awsv4_request(opts) -- Task 4: Add the Signing Information to the Request -- http://docs.aws.amazon.com/general/latest/gr/sigv4-add-signature-to-request.html -- https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html - local authHeader = ALGORITHM - .. " Credential=" .. access_key .. "/" .. credential_scope - .. ", SignedHeaders=" .. canonical_headers.signed_headers - .. ", Signature=" .. signature if opts.sign_query then request_query = request_query .. "&X-Amz-Signature=" .. signature else - request_headers["authorization"] = authHeader + local auth_header = ALGORITHM + .. " Credential=" .. access_key .. "/" .. credential_scope + .. ", SignedHeaders=" .. canonical_headers.signed_headers + .. ", Signature=" .. signature + request_headers["authorization"] = auth_header end return {