Skip to content

fix(rules): preserve equals signs in query parameter values - #122

Open
jashkarangiya wants to merge 1 commit into
requestly:masterfrom
jashkarangiya:fix/preserve-query-param-equals
Open

jashkarangiya wants to merge 1 commit into
requestly:masterfrom
jashkarangiya:fix/preserve-query-param-equals

Conversation

@jashkarangiya

Copy link
Copy Markdown

Closes #121

📜 Summary of changes:

Query parameter parsing previously split on every equals sign and kept only the first part of the value. That changed token=abc== into token=abc whenever a rule rebuilt the URL.

This updates the parser to split on the first equals sign and preserve the rest of the value. Key-only parameters such as ?debug are also kept as key-only parameters.

Regression coverage checks both paths that exposed the bug:

  • adding a parameter while an existing value contains equals signs
  • removing an unrelated parameter while preserving that value

🎥 Demo Video:

Video/Demo: Not applicable. This is a parser-only fix with no UI change.

✅ Checklist:

  • Make sure linting and unit tests pass.
  • No install/build warnings introduced.
  • Verified UI in browser.
  • For UI changes, added/updated analytics events (if applicable).
  • For changes in extension's code, manually tested in Chrome and Firefox.
  • Added/updated unit tests for this change.
  • Raised pull request to update corresponding documentation (if already exists).
  • Added demo video showing the changes in action (if applicable).

🧪 Test instructions:

The production rule-processor build passes with npm run build from common/rule-processor.

Direct checks against the generated bundle pass for:

  1. Adding added=2 to https://example.com?token=abc==&remove=1.
  2. Removing remove from the same URL.
  3. Removing an unrelated parameter while preserving a key-only parameter.

The full Karma suite is not marked as passing. It fails in the same way on untouched upstream master because of the existing shared-constants initialization problem.

🔗 Other references:

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

[Bug] Query parameter rules drop equals signs from existing values

2 participants