Repository navigation
fix(basket): keep & in sanitized URLs so query parameters stay separate - #1135
Conversation
sanitizeUrl reused sanitizeString, which strips &, so /pricing?utm_source=x&plan=pro was stored as /pricing?utm_source=xplan=pro.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
@Adityakk9031 is attempting to deploy a commit to the Databuddy OSS Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
[Medium impact] This PR appears safe to merge. Summary
Reviews (1) · Last reviewed commit: "fix(basket): keep & in sanitized URLs so..." · Reviewed by Greptile |
e108c84
into
databuddy-analytics:staging
Problem
sanitizeUrlreusessanitizeString, which strips&. A tracked path such as/pricing?utm_source=x&plan=prois stored as/pricing?utm_source=xplan=pro, which merges parameters and corrupts the stored path and referrer.Fix
URLs now strip only
<>'";&is kept.sanitizeStringbehaviour is unchanged.Tests
Added a
sanitizeUrlcase invalidation.test.ts; the file passes under vitest.Summary by cubic
Fixes
sanitizeUrlso&is kept in stored URLs. It previously reusedsanitizeString, which strips&, so/pricing?utm_source=x&plan=prowas stored as/pricing?utm_source=xplan=pro, merging query parameters and corrupting stored paths and referrers.URLs now strip only
<>'";sanitizeStringkeeps stripping&as before. A test case was added to verify query parameters stay separate.Written for commit a49620e. Summary will update on new commits.