-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat: decodeQueryValue
and decode query params with support for space
#11
Conversation
* needs to be matched with unjs/ufo#11 * closes #8692, closes #8690
* needs to be matched with unjs/ufo#11 * closes #8692, closes #8690
Codecov Report
@@ Coverage Diff @@
## main #11 +/- ##
==========================================
+ Coverage 84.40% 84.89% +0.48%
==========================================
Files 7 7
Lines 186 192 +6
Branches 51 51
==========================================
+ Hits 157 163 +6
Misses 29 29
Continue to review full report at Codecov.
|
decodeQueryValue
and decode query params with support for space
Released as 0.6.0 |
@@ -12,7 +17,7 @@ export function parseQuery (paramsStr: string = ''): QueryObject { | |||
const s = (param.match(/([^=]+)=?(.*)/) || []) | |||
if (s.length < 2) { continue } | |||
const key = decode(s[1]) |
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.
What if key is having space? The space is replaced with + sign while encoding but on decode it doesn't replace back to space.
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.
Do you mind to make a PR adding test case?
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.
No description provided.