Remove no-longer-used Reddit code.

This commit is contained in:
Brent Simmons committed 2026-11-18 17:46:24 -08:00
1 parent 7f7a675833
commit b8f938f4b8
3 files changed
+1 -18

No files matched your search

@@ -403,7 +403,7 @@ extension DownloadSession {
cancelAndRemoveTasksWithHost(message.host)
}
// Default for sites like Reddit that don’t send a value.
// Default for sites that don’t send a value.
static let defaultRetryAfter: TimeInterval = 10 * 60 // 10 minutes
func createHTTPResponse429(_ dataTask: URLSessionDataTask, _ response: URLResponse) -> HTTPResponse429? {
@@ -79,10 +79,6 @@ nonisolated extension URL {
SpecialCase.urlStringMatchesDomain(absoluteString, [SpecialCase.youtubeHostName])
}
public var isRedditURL: Bool {
SpecialCase.urlStringMatchesDomain(absoluteString, [SpecialCase.redditHostName])
}
/// The Relay FM blog, specifically — not the whole relay.fm domain (its root advertises the master
/// podcast feed). Matches the /blog index and /blog/<post> pages.
public var isRelayFMBlogURL: Bool {
@@ -11,19 +11,6 @@ import Foundation
struct SpecialCasesTests {
@Test func isRedditURLMatchesSubdomains() {
#expect(URL(string: "https://www.reddit.com/r/swift/.rss")!.isRedditURL)
#expect(URL(string: "https://old.reddit.com/r/swift/.rss")!.isRedditURL)
#expect(URL(string: "https://np.reddit.com/r/swift/.rss")!.isRedditURL)
#expect(URL(string: "https://reddit.com/r/swift/.rss")!.isRedditURL)
}
@Test func isRedditURLRejectsLookalikes() {
#expect(!URL(string: "https://notreddit.com/feed")!.isRedditURL)
#expect(!URL(string: "https://reddit.com.evil.example/feed")!.isRedditURL)
#expect(!URL(string: "https://example.com/r/reddit.com")!.isRedditURL)
}
@Test func isYoutubeURLMatchesSubdomains() {
#expect(URL(string: "https://www.youtube.com/watch?v=abc")!.isYoutubeURL)
#expect(URL(string: "https://youtube.com/feeds/videos.xml")!.isYoutubeURL)