Skip to content

Commit f517754

Browse files
data file CDN url changed (#234)
1 parent 312ebba commit f517754

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

OptimizelySDKCore/OptimizelySDKCore/OPTLYNetworkService.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
// ---- Datafile Download URLs ----
2121
// TODO: Move this to the Datafile manager and parameterize the URL for the datafile download
22-
NSString * const OPTLYNetworkServiceCDNServerURL = @"https://cdn.optimizely.com/public/";
22+
NSString * const OPTLYNetworkServiceCDNServerURL = @"https://cdn.optimizely.com/json/";
2323
NSString * const OPTLYNetworkServiceS3ServerURL = @"https://optimizely.s3.amazonaws.com/";
2424

2525
// ---- The total backoff and retry interval is: pow(2, attempts) * interval ----
@@ -103,7 +103,7 @@ - (void)dispatchEvent:(nonnull NSDictionary *)params
103103
+ (NSURL *)projectConfigURLPath:(NSString *)projectId
104104
{
105105
NSURL *cdnURL = [NSURL URLWithString:OPTLYNetworkServiceCDNServerURL];
106-
NSString *filePath = [NSString stringWithFormat:@"%@%@/datafile_v%@.json", cdnURL.absoluteString, projectId, kExpectedDatafileVersion];
106+
NSString *filePath = [NSString stringWithFormat:@"%@%@.json", cdnURL.absoluteString, projectId];
107107
return [NSURL URLWithString:filePath];
108108
}
109109

OptimizelySDKCore/OptimizelySDKCore/OPTLYProjectConfig.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#import "OPTLYFeatureFlag.h"
3232
#import "OPTLYRollout.h"
3333

34-
NSString * const kExpectedDatafileVersion = @"3";
34+
NSString * const kExpectedDatafileVersion = @"4";
3535

3636
@interface OPTLYProjectConfig()
3737

OptimizelySDKCore/OptimizelySDKCoreTests/OPTLYNetworkServiceTest.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
static NSString *const kDatafileVersion = @"3";
2323

24-
static NSString *const kExpectedCDNURLTemplate = @"https://cdn.optimizely.com/public/%@/datafile_v%@.json";
24+
static NSString *const kExpectedCDNURLTemplate = @"https://cdn.optimizely.com/json/%@.json";
2525
static NSString *const kDatamodelDatafileName = @"optimizely_6372300739";
2626
static NSString *const kLastModifiedDate = @"Mon, 28 Nov 2016 06:10:59 GMT";
2727
static NSString *const kProjectId = @"6372300739";
@@ -97,7 +97,7 @@ - (void)testDownloadProjectConfigWithLastModifiedRequestRetrievesProperDatafileV
9797
}
9898

9999
- (void)testProjectConfigURLPathReturnsExpectedUrl {
100-
NSString *expectedURLString = [NSString stringWithFormat:kExpectedCDNURLTemplate, kProjectId, kDatafileVersion];
100+
NSString *expectedURLString = [NSString stringWithFormat:kExpectedCDNURLTemplate, kProjectId];
101101
NSURL *expectedURL = [NSURL URLWithString:expectedURLString];
102102

103103
NSURL *cdnURL = [OPTLYNetworkService projectConfigURLPath:kProjectId];

OptimizelySDKShared/OptimizelySDKSharedTests/OPTLYDatafileManagerTest.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#import "OPTLYDatafileManagerBasic.h"
2020

2121
static NSString *const kProjectId = @"6372300739";
22-
static NSString *const kExpectedCDNURLTemplate = @"https://cdn.optimizely.com/public/%@/datafile_v%@.json";
22+
static NSString *const kExpectedCDNURLTemplate = @"https://cdn.optimizely.com/json/%@.json";
2323

2424
@interface OPTLYDatafileManagerTest : XCTestCase
2525

@@ -28,7 +28,7 @@ @interface OPTLYDatafileManagerTest : XCTestCase
2828
@implementation OPTLYDatafileManagerTest
2929

3030
- (void)testProjectConfigURLPathReturnsExpectedURL {
31-
NSString *expectedURLString = [NSString stringWithFormat:kExpectedCDNURLTemplate, kProjectId, kExpectedDatafileVersion];
31+
NSString *expectedURLString = [NSString stringWithFormat:kExpectedCDNURLTemplate, kProjectId];
3232
NSURL *expectedURL = [NSURL URLWithString:expectedURLString];
3333

3434
NSURL *cdnURL = [OPTLYDatafileManagerUtility projectConfigURLPath:kProjectId];

0 commit comments

Comments
 (0)