3
0
Fork 0

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:
John Maguire 2022-11-21 16:58:02 -05:00 committed by GitHub
parent 4924888879
commit 17cc3477b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -8,8 +8,7 @@ class InvalidCredentialsException: Exception("Invalid credentials")
class APIClient(context: Context) {
private val packageInfo = PackageInfo(context)
private val client = mobileNebula.MobileNebula.newAPIClient(
"%s/%s (Android %s)".format(
packageInfo.getName(),
"MobileNebula/%s (Android %s)".format(
packageInfo.getVersion(),
packageInfo.getSystemVersion(),
))

View File

@ -10,7 +10,7 @@ class APIClient {
init() {
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 {