Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Bad regex breaks with some query strings #426

Closed
Rich-Harris opened this issue Sep 7, 2018 · 0 comments · Fixed by #427
Closed

Bad regex breaks with some query strings #426

Rich-Harris opened this issue Sep 7, 2018 · 0 comments · Fixed by #427
Labels

Comments

@Rich-Harris
Copy link
Member

This line here is incorrect:

const [, key, value] = /([^=]+)=(.*)/.exec(searchParam);

It'll work with ?foo=bar but not ?foo. The pattern should probably be /([^=]+)(?:=(.*))?/.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant