From feda636b0cc0ddc95fa663847117c2ae77fa9a99 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Tue, 3 Nov 2026 14:19:26 -0800 Subject: [PATCH] Check for captive portal redirects on http only, so https sites that moved hosts get their metadata. --- .../Sources/HTMLMetadata/HTMLMetadataDownloader.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/HTMLMetadata/Sources/HTMLMetadata/HTMLMetadataDownloader.swift b/Modules/HTMLMetadata/Sources/HTMLMetadata/HTMLMetadataDownloader.swift index 653178513..67dcd21bc 100644 --- a/Modules/HTMLMetadata/Sources/HTMLMetadata/HTMLMetadataDownloader.swift +++ b/Modules/HTMLMetadata/Sources/HTMLMetadata/HTMLMetadataDownloader.swift @@ -141,7 +141,8 @@ nonisolated private extension HTMLMetadataDownloader { let downloadResponse = try await Downloader.shared.download(actualURL, userAgentStyle: .browser) // A captive portal’s login page would give the home page the portal’s icons. - if let responseURL = downloadResponse.response?.url, Self.isRedirectToAnotherHost(from: actualURL, to: responseURL) { + // Only http is checked, since a portal can’t redirect https without a certificate error. + if actualURL.scheme?.lowercased() == "http", let responseURL = downloadResponse.response?.url, Self.isRedirectToAnotherHost(from: actualURL, to: responseURL) { await returnStaleCacheIfAvailable(url) let userInfo = [NSLocalizedDescriptionKey: "Redirected to \(responseURL.host() ?? responseURL.absoluteString)"] activityLog.didFail(.htmlMetadataDownloader, kind: kind, error: NSError(domain: "NetNewsWire", code: -1, userInfo: userInfo))