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.)
This commit is contained in:
parent
834b0bdb54
commit
e970caf459
|
@ -31,9 +31,7 @@
|
|||
<key>SUFeedURL</key>
|
||||
<string>https://ranchero.com/downloads/evergreen-beta.xml</string>
|
||||
<key>UserAgent</key>
|
||||
<string>Evergreen</string>
|
||||
<key>UserAgentParentheticalAddition</key>
|
||||
<string>Macintosh; RSS Reader; ranchero.com/evergreen/</string>
|
||||
<string>Evergreen (macOS; RSS Reader; https://ranchero.com/evergreen/)</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
|
|
@ -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]? {
|
||||
|
|
Loading…
Reference in New Issue