From 1968986d642deb6cce15129e00654858f2254ccb Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 30 Dec 2017 12:51:37 -0800 Subject: [PATCH] Make User-Agent of the form: Evergreen/1.0d28 (Macintosh; RSS Reader; ranchero.com/evergreen/) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The idea is that anyone looking at their stats can quickly find out what it is. It’s a Mac RSS reader. They can open that URL for even more info. (Before 1.0 ships, at that link will be a link to an article for publishers about RSS readers and lowering bandwidth use. Will talk about conditional GET, etc.) --- Evergreen/Info.plist | 2 ++ Frameworks/RSWeb/RSWeb/UserAgent.swift | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Evergreen/Info.plist b/Evergreen/Info.plist index 71e3ca745..993922244 100644 --- a/Evergreen/Info.plist +++ b/Evergreen/Info.plist @@ -32,6 +32,8 @@ https://ranchero.com/downloads/evergreen-beta.xml UserAgent Evergreen + UserAgentParentheticalAddition + Macintosh; RSS Reader; ranchero.com/evergreen/ NSAppTransportSecurity NSAllowsArbitraryLoads diff --git a/Frameworks/RSWeb/RSWeb/UserAgent.swift b/Frameworks/RSWeb/RSWeb/UserAgent.swift index 3f659e1b1..425869cbf 100755 --- a/Frameworks/RSWeb/RSWeb/UserAgent.swift +++ b/Frameworks/RSWeb/RSWeb/UserAgent.swift @@ -19,6 +19,10 @@ public struct UserAgent { return nil } + if let userAgentParentheticalAddition = Bundle.main.object(forInfoDictionaryKey: "UserAgentParentheticalAddition") { + return "\(userAgentName)/\(version) (\(userAgentParentheticalAddition))" + } + #if os(macOS) let osString = "Macintosh" #elseif os(iOS)