[SDK-2475] Fix for BNCURLFilter's regex being set as external_intent_uri #1419
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thehandleDeepLink
function where if the link which opened the app matches the pattern, we set it as theexternalIntentURI
andreferringURL
. Changing this to set these fields to the actual URI seems to fix this issue and sends the proper requests.Branch.m
Motivation
To fix the bug and correctly set the
external_intent_uri
in requests.Type Of Change
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.