fix: Remove trailing slash from endpoint instead of adding it
Trailing slash is added elsewhere in the codebase, so here we remove it if present to avoid duplication
This commit is contained in:
parent
afe3d1e261
commit
6906509aea
@ -114,13 +114,9 @@ class SettingsServerViewModel {
|
||||
urlComponents.scheme = "https"
|
||||
}
|
||||
|
||||
// Add trailing slash to path if not present
|
||||
if urlComponents.path.isEmpty || !urlComponents.path.hasSuffix("/") {
|
||||
if urlComponents.path.isEmpty {
|
||||
urlComponents.path = "/"
|
||||
} else {
|
||||
urlComponents.path += "/"
|
||||
}
|
||||
// Remove trailing slash from path if present
|
||||
if urlComponents.path.hasSuffix("/") {
|
||||
urlComponents.path = String(urlComponents.path.dropLast())
|
||||
}
|
||||
|
||||
// Remove query parameters (already done above, but double check)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user