Skip to content

Commit b8ec936

Browse files
committedJun 29, 2024
fix: unify urlencoded body serialisation with current query serialisation
Body serialisation now also matches documentation.
1 parent 3317168 commit b8ec936

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
 

‎src/client.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ request.types = {
192192
*/
193193

194194
request.serialize = {
195-
'application/x-www-form-urlencoded': qs.stringify,
195+
'application/x-www-form-urlencoded': (obj) => {
196+
return qs.stringify(obj, { indices: false, strictNullHandling: true });
197+
},
196198
'application/json': safeStringify
197199
};
198200

‎src/node/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ exports.protocols = {
9898
*/
9999

100100
exports.serialize = {
101-
'application/x-www-form-urlencoded': qs.stringify,
101+
'application/x-www-form-urlencoded': (obj) => {
102+
return qs.stringify(obj, { indices: false, strictNullHandling: true });
103+
},
102104
'application/json': safeStringify
103105
};
104106

0 commit comments

Comments
 (0)
Please sign in to comment.