Skip to content

Commit aa43b3d

Browse files
authored
fix: use qs to serialize form data in browser (#1591)
Unifies behavior for Node and browser with regards to 'application/x-www-form-urlencoded'
1 parent f817806 commit aa43b3d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/client.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ if (typeof window !== 'undefined') {
1919

2020
const Emitter = require('component-emitter');
2121
const safeStringify = require('fast-safe-stringify');
22+
const qs = require('qs');
2223
const RequestBase = require('./request-base');
2324
const isObject = require('./is-object');
2425
const ResponseBase = require('./response-base');
@@ -213,7 +214,7 @@ request.types = {
213214
*/
214215

215216
request.serialize = {
216-
'application/x-www-form-urlencoded': serialize,
217+
'application/x-www-form-urlencoded': qs.stringify,
217218
'application/json': safeStringify
218219
};
219220

0 commit comments

Comments
 (0)