Skip to content

Commit

Permalink
Update sigv4.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielRailean committed Feb 29, 2024
1 parent b9ba133 commit e61d4b6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kong/plugins/aws-request-signing/sigv4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit e61d4b6

Please sign in to comment.