Check for captive portal redirects on http only, so https sites that moved hosts get their metadata.

This commit is contained in:
Brent Simmons committed 2026-11-03 14:19:26 -08:00
1 parent 3fb7f9fe46
commit feda636b0c
1 file changed
+2 -1
@@ -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))