File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
Firebase/DynamicLinks/Utilities Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ - (void)_buildFDLLink {
290290 NSURL *link = [NSURL URLWithString: _paramValues[@" linkString" ]];
291291 FIRDynamicLinkComponents *components =
292292 [FIRDynamicLinkComponents componentsWithLink: link
293- domainURIPrefix: _paramValues[@" https://domain " ]];
293+ domainURIPrefix: _paramValues[@" domainURIPrefix " ]];
294294
295295 FIRDynamicLinkGoogleAnalyticsParameters *analyticsParams =
296296 [FIRDynamicLinkGoogleAnalyticsParameters
Original file line number Diff line number Diff line change @@ -1032,6 +1032,12 @@ - (void)testValidCustomDomainNames {
10321032 @" https://a.firebase.com/mypath/mylink" , // Short FDL starting https://a.firebase.com/mypath
10331033 @" https://a.firebase.com/mypath?link=abcd&test=1" , // Long FDL starting with
10341034 // https://a.firebase.com/mypath
1035+ @" https://a.firebase.com/mypath/?link=https://www.google.com&test=1" // Long FDL coming from
1036+ // the app preview page.
1037+ // Note that the long FDL
1038+ // coming from the
1039+ // pasteboard has an extra
1040+ // trailing slash.
10351041 ];
10361042
10371043 for (NSString *urlString in urlStrings) {
Original file line number Diff line number Diff line change @@ -212,10 +212,12 @@ BOOL FIRDLIsURLForWhiteListedCustomDomain(NSURL *_Nullable URL) {
212212 ([urlStr characterAtIndex: domainURIPrefixStr.length] == ' /' ||
213213 [urlStr characterAtIndex: domainURIPrefixStr.length] == ' ?' )) {
214214 // Check if there are any more '/' after the first '/' or '?' trailing the
215- // domainURIPrefix.
215+ // domainURIPrefix. This does not apply to unique match links copied from the clipboard.
216+ // The clipboard links will have '?link=' after the domainURIPrefix.
216217 NSString *urlWithoutDomainURIPrefix =
217218 [urlStr substringFromIndex: domainURIPrefixStr.length + 1 ];
218- if ([urlWithoutDomainURIPrefix rangeOfString: @" /" ].location == NSNotFound ) {
219+ if ([urlWithoutDomainURIPrefix rangeOfString: @" /" ].location == NSNotFound ||
220+ [urlWithoutDomainURIPrefix rangeOfString: @" ?link=" ].location != NSNotFound ) {
219221 customDomainMatchFound = true ;
220222 break ;
221223 }
You can’t perform that action at this time.
0 commit comments