Drop last char in server uri if "/"

This commit is contained in:
Aiden Vigue 2021-05-22 12:18:08 -04:00
parent 2c2b8a29f7
commit 197847c486
1 changed files with 3 additions and 0 deletions

View File

@ -71,6 +71,9 @@ struct ConnectToServerView: View {
if(!_uri.wrappedValue.contains("http")) {
_uri.wrappedValue = "http://" + _uri.wrappedValue;
}
if(_uri.wrappedValue.last == "/") {
_uri.wrappedValue = String(_uri.wrappedValue.dropLast())
}
let request = RestRequest(method: .get, url: uri + "/System/Info/Public")
request.responseObject() { (result: Result<RestResponse<ServerPublicInfoResponse>, RestError>) in
switch result {