From ec2062ad424968e5060d4abe93e309b49daa6164 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 6 Jan 2020 22:14:17 -0500 Subject: [PATCH] Fix not being able to sign into Mastodon instances not in the recommended list --- .../Onboarding/InstanceSelectorTableViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Onboarding/InstanceSelectorTableViewController.swift b/Tusker/Screens/Onboarding/InstanceSelectorTableViewController.swift index 9d48ca6f..95635f01 100644 --- a/Tusker/Screens/Onboarding/InstanceSelectorTableViewController.swift +++ b/Tusker/Screens/Onboarding/InstanceSelectorTableViewController.swift @@ -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"