Skip to content

Commit

Permalink
Update URLBuilder.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
rafiki270 authored May 13, 2019
1 parent a8286ca commit 56ac854
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Sources/S3/URLBuilder/URLBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 56ac854

Please sign in to comment.