Make User-Agent of the form: Evergreen/1.0d28 (Macintosh; RSS Reader; ranchero.com/evergreen/)

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.)
This commit is contained in:
Brent Simmons 2017-12-30 12:51:37 -08:00
parent befc5efc77
commit 1968986d64
2 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,8 @@
<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>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>

View File

@ -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)