Skip to content

Commit 5dd100f

Browse files
authored
Merge pull request owncloud#814 from owncloud/update_user_agent
Update user agent with appversion in the middle
2 parents 1da6d20 + 05f17b4 commit 5dd100f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Owncloud iOs Client/Branding/Customization.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@
130130
#define k_is_shown_help_link_on_login NO
131131
#define k_url_link_on_login @"https://owncloud.com/mobile/new"
132132

133-
//User-Agent
134-
#define k_user_agent @"Mozilla/5.0 (iOS) ownCloud-iOS/"
133+
//User-Agent, Mozilla/5.0 (iOS) ownCloud-iOS/<appVersion> <ob_customUserAgent>
134+
#define k_user_agent @"Mozilla/5.0 (iOS) ownCloud-iOS/$appVersion"
135135

136136
//Enable/Disable Background uploads and download (NSURLSession or NSOperation)
137137
#define k_is_background_active YES

Owncloud iOs Client/Utils/UtilsUrls.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ + (NSString *)getFullRemoteServerParentPathByFile:(FileDto *) file andUser:(User
559559

560560
+ (NSString *) getUserAgent {
561561
NSString *appVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
562-
NSString *userAgentWithAppVersion = [NSString stringWithFormat:@"%@%@",k_user_agent,appVersion];
562+
NSString *userAgentWithAppVersion = [NSString stringWithFormat:@"%@",[k_user_agent stringByReplacingOccurrencesOfString:@"$appVersion" withString:appVersion]];
563563

564564
return userAgentWithAppVersion;
565565

0 commit comments

Comments
 (0)