-
Notifications
You must be signed in to change notification settings - Fork 192
fix: Mask cookie campaign params #2297
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Size Change: +536 B (+0.01%) Total Size: 5.13 MB
ℹ️ View Unchanged
|
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
@robbie-c any reason why this is still in draft? |
Only that I had bigger fish to fry. Let's get this merged though |
a4dbdcc
to
ab1e72b
Compare
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.
5 files reviewed, 2 comments
} | ||
|
||
// replace any query params in the url with the provided mask value. Tries to keep the URL as instant as possible, | ||
// replace any query params in the url with the provided mask value. Tries to keep the URL as intact as possible, |
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.
syntax: typo: "instant" should be "intact"
// replace any query params in the url with the provided mask value. Tries to keep the URL as intact as possible, | |
// replace any query params in the url with the provided mask value. Tries to keep the URL as intact as possible, |
maskQueryParams(document.URL, paramsToMask, MASKED), | ||
customTrackedParams | ||
) | ||
const urlCampaignParams = _getCampaignParamsFromUrl(document.URL, config?.custom_campaign_params) |
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.
logic: removed masking from URL extraction which could expose sensitive URL parameters
const urlCampaignParams = _getCampaignParamsFromUrl(document.URL, config?.custom_campaign_params) | |
const urlCampaignParams = _getCampaignParamsFromUrl(maskQueryParams(document.URL, paramsToMask, MASKED), config?.custom_campaign_params) |
d215c0e
to
c2b1f60
Compare
@rafaeelaudibert I remembered why, it's because web experiments called this from a static function, and I didn't want to refactor it. I just did that, tagging @PostHog/team-experiments in case you want to have a look at the changes |
You are truly British, can I have some with chips? |
This PR hasn't seen activity in a week! Should it be merged, closed, or further worked on? If you want to keep it open, post a comment or remove the |
This PR was closed due to lack of activity. Feel free to reopen if it's still relevant. |
Problem
I noticed that the code to mask campaign params was not being applied to the params from cookies.
Changes
Mask cookie params as well.
As part of this, I had to make some web-experiments static methods no longer static, and update the test suite
Release info Sub-libraries affected
Libraries affected
Checklist
If releasing new changes
pnpm changeset
to generate a changeset file