File tree 2 files changed +10
-8
lines changed
macos/RNCookieManagerMacOs
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 5
5
* LICENSE file here: https://github.com/joeferraro/react-native-cookies/blob/master/LICENSE.md.
6
6
*/
7
7
8
- #if __has_include("RCTBridgeModule.h")
9
- #import " RCTBridgeModule.h"
10
- #else
11
8
#import < React/RCTBridgeModule.h>
12
- #endif
13
9
14
10
#import < WebKit/WebKit.h>
15
11
Original file line number Diff line number Diff line change 6
6
*/
7
7
8
8
#import " RNCookieManagerMacOS.h"
9
- #if __has_include("RCTConvert.h")
10
- #import " RCTConvert.h"
11
- #else
12
9
#import < React/RCTConvert.h>
13
- #endif
14
10
15
11
static NSString * const NOT_AVAILABLE_ERROR_MESSAGE = @" WebKit/WebKit-Components are only available with macOS 10.2 and higher!" ;
16
12
static NSString * const INVALID_URL_MISSING_HTTP = @" Invalid URL: It may be missing a protocol (ex. http:// or https://)." ;
@@ -340,4 +336,14 @@ -(NSDictionary *)createCookieData:(NSHTTPCookie *)cookie
340
336
return cookieData;
341
337
}
342
338
339
+ -(BOOL )isMatchingDomain : (NSString *)originDomain
340
+ cookieDomain : (NSString *)cookieDomain
341
+ {
342
+ if ([originDomain isEqualToString: cookieDomain]) {
343
+ return @YES ;
344
+ }
345
+ NSString *parentDomain = [cookieDomain hasPrefix: @" ." ] ? cookieDomain : [@" ." stringByAppendingString: cookieDomain];
346
+ return [originDomain hasSuffix: parentDomain];
347
+ }
348
+
343
349
@end
You can’t perform that action at this time.
0 commit comments