File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Leanplum-SDK/Classes/MessageTemplates Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ - (void)tearDown {
2626}
2727
2828- (void )testThatURLEncodingWorksForUnreservedCharacters {
29- // Test characters @":-._~/?&=#"
29+ // Test characters @":-._~/?&=#+ "
3030 // Note: all of them includes : . / charachers
3131
3232 NSString *url;
@@ -74,6 +74,12 @@ - (void)testThatURLEncodingWorksForUnreservedCharacters {
7474 template = [self createTemplateWithUrl: url];
7575 encodedURL= [template urlEncodedStringFromString: [template.context stringNamed: LPMT_ARG_URL]];
7676 XCTAssertEqualObjects (url, encodedURL);
77+
78+ // test for + sign
79+ url = @" http://test.com/test+end" ;
80+ template = [self createTemplateWithUrl: url];
81+ encodedURL= [template urlEncodedStringFromString: [template.context stringNamed: LPMT_ARG_URL]];
82+ XCTAssertEqualObjects (url, encodedURL);
7783}
7884
7985- (LPOpenUrlMessageTemplate *)createTemplateWithUrl : (NSString *)url {
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ - (void) openURL
5050}
5151
5252- (NSString *)urlEncodedStringFromString : (NSString *)urlString {
53- NSString *unreserved = @" :-._~/?&=#" ;
53+ NSString *unreserved = @" :-._~/?&=#+ " ;
5454 NSMutableCharacterSet *allowed = [NSMutableCharacterSet
5555 alphanumericCharacterSet ];
5656 [allowed addCharactersInString: unreserved];
You can’t perform that action at this time.
0 commit comments