-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User-Agent is localized #1269
Comments
Great question @onmyway133! We'll have to do some investigation here and get back to you. |
Probably not a good idea, as Apple's docs explicitly call out not using the value for parsing. Manually creating the version string from |
I agree @jshier. I'll work on putting together a fix. |
We've discovered this as well in our own internal attempts to set headers w/ the current OS version. Has anyone had success actually getting |
This is my temp solution public static let osInfo: (version: String, build: String) = {
let version = UIDevice.currentDevice().systemVersion
var build = ""
let os = NSProcessInfo.processInfo().operatingSystemVersionString
let regex = try? NSRegularExpression(pattern: "\\(.*\\)", options: [])
if let range = regex?.firstMatchInString(os, options: [], range: NSRange(location: 0, length: os.characters.count))?.range {
let parts = (os as NSString).substringWithRange(range)
.replace("(", with: "")
.replace(")", with: "")
.split(" ")
if parts.count == 2 {
build = parts[1]
}
}
return (version: version, build: build)
}() |
Hi, I see that
User-Agent
inManager
https://github.com/Alamofire/Alamofire/blob/master/Source/Manager.swift#L64 is localizedbecause of this
is this good?
The text was updated successfully, but these errors were encountered: