-
Notifications
You must be signed in to change notification settings - Fork 51
fix(analytics-browser): exclude "port" when checking "excludeReferrer" in marketing attribution #1219
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
base: main
Are you sure you want to change the base?
fix(analytics-browser): exclude "port" when checking "excludeReferrer" in marketing attribution #1219
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,8 +61,10 @@ export const isNewCampaign = ( | |
}; | ||
|
||
export const isExcludedReferrer = (excludeReferrers: (string | RegExp)[] = [], referringDomain = '') => { | ||
// remove port from referringDomain | ||
const referringDomainWithoutPort = referringDomain.split(':')[0]; | ||
return excludeReferrers.some((value) => | ||
value instanceof RegExp ? value.test(referringDomain) : value === referringDomain, | ||
value instanceof RegExp ? value.test(referringDomainWithoutPort) : value === referringDomainWithoutPort, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: IPv6 Address Parsing ErrorThe |
||
); | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The variable name
referringDomainWithoutPort
is verbose and could be simplified todomainWithoutPort
ordomain
for better readability.Copilot uses AI. Check for mistakes.