From 8bac72e5c08e7c9fec2158aac8f451de315c6582 Mon Sep 17 00:00:00 2001 From: Nate Weaver Date: Sun, 18 Jul 2021 17:01:59 -0500 Subject: [PATCH] Fix favicons when a feed's homepage URL has non-ASCII in its path --- Shared/Favicons/FaviconDownloader.swift | 2 +- Shared/Favicons/FaviconURLFinder.swift | 2 +- Shared/HTMLMetadata/HTMLMetadataDownloader.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Shared/Favicons/FaviconDownloader.swift b/Shared/Favicons/FaviconDownloader.swift index 99d8dd2e6..bda684e43 100644 --- a/Shared/Favicons/FaviconDownloader.swift +++ b/Shared/Favicons/FaviconDownloader.swift @@ -200,7 +200,7 @@ private extension FaviconDownloader { func findFaviconURLs(with homePageURL: String, _ completion: @escaping ([String]?) -> Void) { - guard let url = URL(string: homePageURL) else { + guard let url = URL(unicodeString: homePageURL) else { completion(nil) return } diff --git a/Shared/Favicons/FaviconURLFinder.swift b/Shared/Favicons/FaviconURLFinder.swift index cc429e4c6..dd51da4a5 100644 --- a/Shared/Favicons/FaviconURLFinder.swift +++ b/Shared/Favicons/FaviconURLFinder.swift @@ -42,7 +42,7 @@ struct FaviconURLFinder { /// - urls: An array of favicon URLs as strings. static func findFaviconURLs(with homePageURL: String, _ completion: @escaping (_ urls: [String]?) -> Void) { - guard let _ = URL(string: homePageURL) else { + guard let _ = URL(unicodeString: homePageURL) else { completion(nil) return } diff --git a/Shared/HTMLMetadata/HTMLMetadataDownloader.swift b/Shared/HTMLMetadata/HTMLMetadataDownloader.swift index 40651d420..4f2404868 100644 --- a/Shared/HTMLMetadata/HTMLMetadataDownloader.swift +++ b/Shared/HTMLMetadata/HTMLMetadataDownloader.swift @@ -15,7 +15,7 @@ struct HTMLMetadataDownloader { static let serialDispatchQueue = DispatchQueue(label: "HTMLMetadataDownloader") static func downloadMetadata(for url: String, _ completion: @escaping (RSHTMLMetadata?) -> Void) { - guard let actualURL = URL(string: url) else { + guard let actualURL = URL(unicodeString: url) else { completion(nil) return }