-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
querystring.parse
decodes incorrect in a specific case
#13773
Comments
Aside from the issue, it is generally recommended that you use the new |
After 5 hours of struggling with a an intermittent issue in the encoding of some of the POSTs received from our website, we tracked down the issue to this change in handling trailing spaces. The "random" nature of the issue was caused by the fact that some people submitted the form input with a trailing space. So, is this a bug or an expected "changed behaviour" ??? |
There are a lot more problematic cases // str v8.x v6.x expected
'af+' {} {} { 'af ': '' }
'af+&' {} { 'af ': '' } { 'af ': '' } REGRESSION
'%20+' {} {} { ' ': '' }
'%20+&' {} { ' ': '' } { ' ': '' } REGRESSION
'+' {} {} { ' ': '' }
'+&' {} { ' ': '' } { ' ': '' } REGRESSION |
@jsilveira It is a bug. |
Use lastPos ONLY for tracking what has been .slice()'d, never as an indication of if key/value has been seen, since lastPos is updated on seeing + as well. Fixes: nodejs#13773
Use lastPos ONLY for tracking what has been .slice()'d, never as an indication of if key/value has been seen, since lastPos is updated on seeing + as well. PR-URL: #14151 Fixes: #13773 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Brian White <[email protected]>
Use lastPos ONLY for tracking what has been .slice()'d, never as an indication of if key/value has been seen, since lastPos is updated on seeing + as well. PR-URL: #14151 Fixes: #13773 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Brian White <[email protected]>
Use lastPos ONLY for tracking what has been .slice()'d, never as an indication of if key/value has been seen, since lastPos is updated on seeing + as well. PR-URL: #14151 Fixes: #13773 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Brian White <[email protected]>
At Node 7.* or before, the result of
require('querystring').parse('a=%20+&')
is{ a: ' ' }
. However, at Node 8.0.0 or 8.1.2, the result ofrequire('querystring').parse('a=%20+&')
is{ a: '%20 ' }
.%20
doesn't decode when it is before+
.The text was updated successfully, but these errors were encountered: