diff --git a/lib/src/models/decode_options.dart b/lib/src/models/decode_options.dart index 8cd7993..8eb1a38 100644 --- a/lib/src/models/decode_options.dart +++ b/lib/src/models/decode_options.dart @@ -26,7 +26,7 @@ final class DecodeOptions with EquatableMixin { this.parseLists = true, this.strictNullHandling = false, }) : allowDots = allowDots ?? decodeDotInKeys == true || false, - decodeDotInKeys = decodeDotInKeys ?? true, + decodeDotInKeys = decodeDotInKeys ?? false, _decoder = decoder, assert( charset == utf8 || charset == latin1, diff --git a/test/unit/decode_test.dart b/test/unit/decode_test.dart index c224e44..6c4dbb9 100644 --- a/test/unit/decode_test.dart +++ b/test/unit/decode_test.dart @@ -210,6 +210,26 @@ void main() { 'name.obj.subobject': {'first.godly.name': 'John', 'last': 'Doe'} }), ); + expect( + QS.decode('name%252Eobj.first=John&name%252Eobj.last=Doe'), + equals({'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe'}), + ); + expect( + QS.decode( + 'name%252Eobj.first=John&name%252Eobj.last=Doe', + const DecodeOptions(decodeDotInKeys: false), + ), + equals({'name%2Eobj.first': 'John', 'name%2Eobj.last': 'Doe'}), + ); + expect( + QS.decode( + 'name%252Eobj.first=John&name%252Eobj.last=Doe', + const DecodeOptions(decodeDotInKeys: true), + ), + equals({ + 'name.obj': {'first': 'John', 'last': 'Doe'} + }), + ); }); test( diff --git a/test/unit/models/decode_options_test.dart b/test/unit/models/decode_options_test.dart index 80bfd29..a6ca091 100644 --- a/test/unit/models/decode_options_test.dart +++ b/test/unit/models/decode_options_test.dart @@ -122,7 +122,7 @@ void main() { ' charset: Instance of \'Latin1Codec\',\n' ' charsetSentinel: true,\n' ' comma: true,\n' - ' decodeDotInKeys: true,\n' + ' decodeDotInKeys: false,\n' ' delimiter: ,,\n' ' depth: 10,\n' ' duplicates: combine,\n'