Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK-2475] Fix for BNCURLFilter's regex being set as external_intent_uri #1419

Merged
merged 3 commits into from
Aug 20, 2024

Conversation

nsingh-branch
Copy link
Contributor

Reference

SDK-2475 -- Fix bug where URL filter regex is being sent as external_intent_uri

Summary

We have been seeing requests where the external_intent_uri is one of the values in our URL filter pattern likes, like "^fb\\d+:((?!campaign_ids).)*$". This appears to be due to a typo in the handleDeepLink function where if the link which opened the app matches the pattern, we set it as the externalIntentURI and referringURL. Changing this to set these fields to the actual URI seems to fix this issue and sends the proper requests.

Branch.m

   pattern = [self.urlFilter patternMatchingURL:url];
    if (!pattern) {
        pattern = [self.userURLFilter patternMatchingURL:url];
    }
    if (pattern) {
        self.preferenceHelper.dropURLOpen = YES;

        //Problematic Lines
        self.preferenceHelper.externalIntentURI = pattern;
        self.preferenceHelper.referringURL = pattern;
        //

        [self initUserSessionAndCallCallback:YES sceneIdentifier:sceneIdentifier urlString:nil];
        return NO;
    }

Motivation

To fix the bug and correctly set the external_intent_uri in requests.

Type Of Change

  • Bug fix (non-breaking change which fixes an issue)

Testing Instructions

Add any URI scheme that matches the regex to your app and then open your app via that link. Observe the request's external_intent_uri before and after the change.

Possible URI schemes:
Facebook: fb1234://some_path
LinkedIn: li5678://profile
Pinterest: pdk91011://board
TwitterKit: twitterkit-xyz123://timeline
Google OAuth: com.googleusercontent.apps.1234567890-abcdef:/oauth
Sensitive Info, Non-HTTP/HTTPS: customscheme://login?oauth_token=abcdef123456
Sensitive Info, HTTP/HTTPS: https://example.com/resource?access_token=abcdef123456

cc @BranchMetrics/saas-sdk-devs for visibility.

Copy link
Collaborator

@NidhiDixit09 NidhiDixit09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@nsingh-branch nsingh-branch merged commit 21e2b57 into master Aug 20, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants