forked from core/mobile_nebula
Make user agent consistent on iOS and Android (#98)
Instead of Nebula/, Nebula-DEBUG/, and NebulaNetworkExtension/, ensure that the user agent is always MobileNebula/.
This commit is contained in:
parent
4924888879
commit
17cc3477b7
|
@ -8,8 +8,7 @@ class InvalidCredentialsException: Exception("Invalid credentials")
|
||||||
class APIClient(context: Context) {
|
class APIClient(context: Context) {
|
||||||
private val packageInfo = PackageInfo(context)
|
private val packageInfo = PackageInfo(context)
|
||||||
private val client = mobileNebula.MobileNebula.newAPIClient(
|
private val client = mobileNebula.MobileNebula.newAPIClient(
|
||||||
"%s/%s (Android %s)".format(
|
"MobileNebula/%s (Android %s)".format(
|
||||||
packageInfo.getName(),
|
|
||||||
packageInfo.getVersion(),
|
packageInfo.getVersion(),
|
||||||
packageInfo.getSystemVersion(),
|
packageInfo.getSystemVersion(),
|
||||||
))
|
))
|
||||||
|
|
|
@ -10,7 +10,7 @@ class APIClient {
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
let packageInfo = PackageInfo()
|
let packageInfo = PackageInfo()
|
||||||
apiClient = MobileNebulaNewAPIClient("\(packageInfo.getName())/\(packageInfo.getVersion()) (iOS \(packageInfo.getSystemVersion()))")!
|
apiClient = MobileNebulaNewAPIClient("MobileNebula/\(packageInfo.getVersion()) (iOS \(packageInfo.getSystemVersion()))")!
|
||||||
}
|
}
|
||||||
|
|
||||||
func enroll(code: String) throws -> IncomingSite {
|
func enroll(code: String) throws -> IncomingSite {
|
||||||
|
|
Loading…
Reference in New Issue