Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Sources/S3Signer/S3Signer+Private.swift
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,18 @@ extension S3Signer {

let region = region ?? config.region

updatedHeaders["host"] = url.host ?? region.host
var hostname: String

if let host = url.host {
hostname = host
if let port = url.port {
hostname = hostname + ":\(port)"
}
} else {
hostname = region.host
}

updatedHeaders["host"] = hostname

let (canonRequest, fullURL) = try presignedURLCanonRequest(httpMethod, dates: dates, expiration: expiration, url: url, region: region, headers: updatedHeaders)

Expand Down