Skip to content

Commit

Permalink
[Fix] parse: Disable decodeDotInKeys by default to restore previo…
Browse files Browse the repository at this point in the history
…us behavior

Fixes #500.
  • Loading branch information
wwaaijer-exh authored and ljharb committed Apr 5, 2024
1 parent fd3cd7a commit 7e18298
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parse.js
Expand Up @@ -14,7 +14,7 @@ var defaults = {
charset: 'utf-8',
charsetSentinel: false,
comma: false,
decodeDotInKeys: true,
decodeDotInKeys: false,
decoder: utils.decode,
delimiter: '&',
depth: 5,
Expand Down
5 changes: 5 additions & 0 deletions test/parse.js
Expand Up @@ -108,6 +108,11 @@ test('parse()', function (t) {
{ 'name.obj.subobject': { 'first.godly.name': 'John', last: 'Doe' } },
'with allowDots true and decodeDotInKeys true'
);
st.deepEqual(
qs.parse('name%252Eobj.first=John&name%252Eobj.last=Doe'),
{ 'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe' },
'with allowDots and decodeDotInKeys undefined'
);

st.end();
});
Expand Down

0 comments on commit 7e18298

Please sign in to comment.