diff --git a/Sources/S3/URLBuilder/URLBuilder.swift b/Sources/S3/URLBuilder/URLBuilder.swift index 67dfea5..bf9b6f2 100644 --- a/Sources/S3/URLBuilder/URLBuilder.swift +++ b/Sources/S3/URLBuilder/URLBuilder.swift @@ -14,16 +14,10 @@ extension Region { /// Host URL including scheme public func hostUrlString(bucket: String? = nil) -> String { - if hostName != nil { - return urlProtocol + host.finished(with: "/") + (bucket ?? "") + if let bucket = bucket { + return urlProtocol + host.finished(with: "/") + bucket } - - var bucket = bucket - if let b = bucket, !b.isEmpty { - bucket = b + "." - } - - return urlProtocol + (bucket ?? "") + host.finished(with: "/") + return urlProtocol + host.finished(with: "/") } private var urlProtocol: String {