From 56ac85455616b15c8cf1a49512edbcd4f1e8df26 Mon Sep 17 00:00:00 2001 From: Ondrej Rafaj Date: Mon, 13 May 2019 22:54:37 +0100 Subject: [PATCH] Update URLBuilder.swift --- Sources/S3/URLBuilder/URLBuilder.swift | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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 {