Fix not being able to sign into Mastodon instances not in the

recommended list
This commit is contained in:
Shadowfacts 2020-01-06 22:14:17 -05:00
parent 1e066ac28e
commit ec2062ad42
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 3 additions and 1 deletions

View File

@ -159,7 +159,9 @@ class InstanceSelectorTableViewController: UITableViewController {
}
switch item {
case let .selected(instance):
delegate.didSelectInstance(url: URL(string: instance.uri)!)
// we can't just turn the URI string from the API into a URL instance, because Mastodon only includes the domain in the "URI"
let components = parseURLComponents(input: instance.uri)
delegate.didSelectInstance(url: components.url!)
case let .recommended(instance):
var components = URLComponents()
components.scheme = "https"