cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject ios commit: CB-5420 Add device model to User-Agent cache key.
Date Fri, 03 Jan 2014 19:28:54 GMT
Updated Branches:
  refs/heads/master e67449d51 -> baf270f2a


CB-5420 Add device model to User-Agent cache key.

Fixes wrong UA on Simulator.


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/baf270f2
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/baf270f2
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/baf270f2

Branch: refs/heads/master
Commit: baf270f2adca7f983224c91be94ddc1d0c8c95b0
Parents: e67449d
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Fri Jan 3 14:28:05 2014 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Jan 3 14:28:05 2014 -0500

----------------------------------------------------------------------
 CordovaLib/Classes/CDVUserAgentUtil.m | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/baf270f2/CordovaLib/Classes/CDVUserAgentUtil.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVUserAgentUtil.m b/CordovaLib/Classes/CDVUserAgentUtil.m
index 9923d47..8476e53 100644
--- a/CordovaLib/Classes/CDVUserAgentUtil.m
+++ b/CordovaLib/Classes/CDVUserAgentUtil.m
@@ -43,7 +43,9 @@ static NSMutableArray* gPendingSetUserAgentBlocks = nil;
         NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
         NSString* systemVersion = [[UIDevice currentDevice] systemVersion];
         NSString* localeStr = [[NSLocale currentLocale] localeIdentifier];
-        NSString* systemAndLocale = [NSString stringWithFormat:@"%@ %@", systemVersion, localeStr];
+        // Record the model since simulator can change it without re-install (CB-5420).
+        NSString* model = [UIDevice currentDevice].model;
+        NSString* systemAndLocale = [NSString stringWithFormat:@"%@ %@ %@", model, systemVersion,
localeStr];
 
         NSString* cordovaUserAgentVersion = [userDefaults stringForKey:kCdvUserAgentVersionKey];
         gOriginalUserAgent = [userDefaults stringForKey:kCdvUserAgentKey];


Mime
View raw message