From 78ec33953071f70ffa4689d9000aa2c7bebc6855 Mon Sep 17 00:00:00 2001 From: Ahmad Husseini Date: Mon, 15 May 2017 10:19:06 -0400 Subject: [PATCH] dictionary returned from sign function now includes headers passed to it Added contents of header parameter to the returned header dictionary --- Sources/AWSSignatureV4/AWSSignatureV4.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Sources/AWSSignatureV4/AWSSignatureV4.swift b/Sources/AWSSignatureV4/AWSSignatureV4.swift index 6949c10..22f6fd6 100644 --- a/Sources/AWSSignatureV4/AWSSignatureV4.swift +++ b/Sources/AWSSignatureV4/AWSSignatureV4.swift @@ -192,11 +192,19 @@ extension AWSSignatureV4 { signature: signature, signedHeaders: signedHeaders ) - - return [ + + + var requestHeaders: [HeaderKey: String] = [ "X-Amz-Date": amzDate, "x-amz-content-sha256": payloadHash, "Authorization": authorizationHeader ] + + headers.forEach { key, value in + let headerKey = HeaderKey(stringLiteral: key) + requestHeaders[headerKey] = value + } + + return requestHeaders } }