From e970caf45916142d803bab1cfc4a216b56b47104 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sun, 31 Dec 2017 10:09:40 -0800 Subject: [PATCH] Freeze the user agent as Evergreen (macOS; RSS Reader; https://ranchero.com/evergreen/). (An iOS version would say iOS rather than macOS, but would be the same otherwise.) --- Evergreen/Info.plist | 4 +--- Frameworks/RSWeb/RSWeb/UserAgent.swift | 19 +------------------ 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/Evergreen/Info.plist b/Evergreen/Info.plist index a672a2df1..6e90c7418 100644 --- a/Evergreen/Info.plist +++ b/Evergreen/Info.plist @@ -31,9 +31,7 @@ SUFeedURL https://ranchero.com/downloads/evergreen-beta.xml UserAgent - Evergreen - UserAgentParentheticalAddition - Macintosh; RSS Reader; ranchero.com/evergreen/ + Evergreen (macOS; RSS Reader; https://ranchero.com/evergreen/) NSAppTransportSecurity NSAllowsArbitraryLoads diff --git a/Frameworks/RSWeb/RSWeb/UserAgent.swift b/Frameworks/RSWeb/RSWeb/UserAgent.swift index 425869cbf..0a851c51d 100755 --- a/Frameworks/RSWeb/RSWeb/UserAgent.swift +++ b/Frameworks/RSWeb/RSWeb/UserAgent.swift @@ -12,24 +12,7 @@ public struct UserAgent { public static func fromInfoPlist() -> String? { - guard let userAgentName = Bundle.main.object(forInfoDictionaryKey: "UserAgent") else { - return nil - } - guard let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") else { - return nil - } - - if let userAgentParentheticalAddition = Bundle.main.object(forInfoDictionaryKey: "UserAgentParentheticalAddition") { - return "\(userAgentName)/\(version) (\(userAgentParentheticalAddition))" - } - - #if os(macOS) - let osString = "Macintosh" - #elseif os(iOS) - let osString = "iOS" - #endif - - return "\(userAgentName)/\(version) (\(osString))" + return Bundle.main.object(forInfoDictionaryKey: "UserAgent") as? String } public static func headers() -> [AnyHashable: String]? {