File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Source/ObjectiveDropboxOfficial/Shared/Handwritten/Networking Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
30
30
@property (nonatomic , readonly , copy ) NSString *meta;
31
31
@property (nonatomic , readonly , copy ) NSString *api;
32
32
@property (nonatomic , readonly , copy ) NSString *content;
33
+ @property (nonatomic , readonly , copy ) NSString *downloadContent;
33
34
@property (nonatomic , readonly , copy ) NSString *notify;
34
35
35
36
// /
@@ -45,11 +46,12 @@ NS_ASSUME_NONNULL_BEGIN
45
46
// / @param meta the hostname to metaserver
46
47
// / @param api the hostname to api server
47
48
// / @param content the hostname to content server
49
+ // / @param downloadContent the hostname to content server for download style
48
50
// / @param notify the hostname to notify server
49
51
// /
50
52
// / @return An initialized instance with the provided hostname configuration
51
53
// /
52
- - (instancetype )initWithMeta : (NSString *)meta api : (NSString *)api content : (NSString *)content notify : (NSString *)notify ;
54
+ - (instancetype )initWithMeta : (NSString *)meta api : (NSString *)api content : (NSString *)content downloadContent : ( NSString *) downloadContent notify : (NSString *)notify ;
53
55
54
56
// /
55
57
// / Returns the prefix to use for API calls to the given route type.
Original file line number Diff line number Diff line change @@ -41,17 +41,32 @@ - (instancetype)initWithMeta:(NSString *)meta
41
41
_meta = meta;
42
42
_api = api;
43
43
_content = content;
44
+ _downloadContent = content;
44
45
_notify = notify;
45
46
}
46
47
return self;
47
48
}
48
49
50
+ - (instancetype )initWithMeta : (NSString *)meta
51
+ api : (NSString *)api
52
+ content : (NSString *)content
53
+ downloadContent : (NSString *)downloadContent
54
+ notify : (NSString *)notify {
55
+ self = [self initWithMeta: meta api: api content: content notify: notify];
56
+ _downloadContent = downloadContent;
57
+ return self;
58
+ }
59
+
49
60
- (nullable NSString *)apiV2PrefixWithRoute : (DBRoute *)route {
50
61
switch (route.host ) {
51
62
case DBRouteHostApi:
52
63
return [NSString stringWithFormat: @" https://%@ /2" , _api];
53
64
case DBRouteHostContent:
54
- return [NSString stringWithFormat: @" https://%@ /2" , _content];
65
+ if ([route.attrs[@" style" ] isEqualToString: @" download" ]) {
66
+ return [NSString stringWithFormat: @" https://%@ /2" , _downloadContent];
67
+ } else {
68
+ return [NSString stringWithFormat: @" https://%@ /2" , _content];
69
+ }
55
70
case DBRouteHostNotify:
56
71
return [NSString stringWithFormat: @" https://%@ /2" , _notify];
57
72
case DBRouteHostUnknown:
You can’t perform that action at this time.
0 commit comments