diff --git a/NetNewsWire/Favicons/FaviconDownloader.swift b/NetNewsWire/Favicons/FaviconDownloader.swift index 3a820003a..454f2b374 100644 --- a/NetNewsWire/Favicons/FaviconDownloader.swift +++ b/NetNewsWire/Favicons/FaviconDownloader.swift @@ -70,7 +70,7 @@ final class FaviconDownloader { func favicon(withHomePageURL homePageURL: String) -> NSImage? { - let url = normalizedHomePageURL(homePageURL) + let url = homePageURL.rs_normalizedURL() if homePageURLsWithNoFaviconURL.contains(url) { return nil } @@ -135,24 +135,6 @@ private extension FaviconDownloader { } } - func normalizedHomePageURL(_ url: String) -> String { - - // Many times the homePageURL is missing a trailing /. - // We add one when needed. - - guard !url.hasSuffix("/") else { - return url - } - let lowercasedURL = url.lowercased(with: FaviconDownloader.localeForLowercasing) - guard lowercasedURL.hasPrefix("http://") || lowercasedURL.hasPrefix("https://") else { - return url - } - guard url.components(separatedBy: "/").count < 4 else { - return url - } - return url + "/" - } - func faviconDownloader(withURL faviconURL: String) -> SingleFaviconDownloader { if let downloader = singleFaviconDownloaderCache[faviconURL] {