Skip to content

Commit 40f0340

Browse files
committed
Remove trailing slashes from the NS URL.
1 parent 0a8feea commit 40f0340

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Loop/Models/ServiceAuthentication/NightscoutService.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ class NightscoutService: ServiceAuthenticationUI {
5555
}
5656

5757
var siteURL: URL? {
58-
if let URLString = credentialValues[0], !URLString.isEmpty {
58+
if var URLString = credentialValues[0], !URLString.isEmpty {
59+
while URLString.last == "/" {
60+
URLString.remove(at: URLString.index(before: URLString.endIndex))
61+
}
5962
return URL(string: URLString)
6063
}
6164

0 commit comments

Comments
 (0)