diff --git a/Packages/Pachyderm/Sources/Pachyderm/Client.swift b/Packages/Pachyderm/Sources/Pachyderm/Client.swift index f1808ec3..ab3c4c55 100644 --- a/Packages/Pachyderm/Sources/Pachyderm/Client.swift +++ b/Packages/Pachyderm/Sources/Pachyderm/Client.swift @@ -7,6 +7,7 @@ // import Foundation +import WebURL /** The base Mastodon API client. @@ -186,9 +187,9 @@ public class Client { case let .success(wellKnown, _): if let url = wellKnown.links.first(where: { $0.rel == "http://nodeinfo.diaspora.software/ns/schema/2.0" }), - let components = URLComponents(string: url.href), - components.host == self.baseURL.host { - let nodeInfo = Request(method: .get, path: Endpoint(stringLiteral: components.path)) + let href = WebURL(url.href), + href.host == WebURL(self.baseURL)?.host { + let nodeInfo = Request(method: .get, path: Endpoint(stringLiteral: href.path)) self.run(nodeInfo, completion: completion) } }