Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
Use proper date format for credential scope date; make X-Amz-Date low…
Browse files Browse the repository at this point in the history
…ercase
  • Loading branch information
cweinberger committed Dec 30, 2019
1 parent 8c728f8 commit bf060bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/Storage/Utilities/S3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public struct AWSSignatureV4 {
let date = unitTestDate ?? Date()
let dateFormatter = DateFormatter()
dateFormatter.timeZone = TimeZone(secondsFromGMT: 0)
dateFormatter.dateFormat = "YYYYMMdd"
dateFormatter.dateFormat = "yyyyMMdd"
return dateFormatter.string(from: date)
}
}
Expand All @@ -191,7 +191,7 @@ extension AWSSignatureV4 {
hash: String
) {
headers["Host"] = host
headers["X-Amz-Date"] = amzDate
headers["x-amz-date"] = amzDate

if hash != "UNSIGNED-PAYLOAD" {
headers["x-amz-content-sha256"] = hash
Expand Down Expand Up @@ -279,7 +279,7 @@ extension AWSSignatureV4 {
)

var requestHeaders: [String: String] = [
"X-Amz-Date": amzDate,
"x-amz-date": amzDate,
"Content-Type": contentType,
"x-amz-content-sha256": payloadHash,
"Authorization": authorizationHeader,
Expand Down

0 comments on commit bf060bc

Please sign in to comment.