Skip to content

Commit

Permalink
fix: use qs to serialize form data in browser (#1591)
Browse files Browse the repository at this point in the history
Unifies behavior for Node and browser with regards to  'application/x-www-form-urlencoded'
  • Loading branch information
dsanders11 committed Aug 30, 2020
1 parent f817806 commit aa43b3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ if (typeof window !== 'undefined') {

const Emitter = require('component-emitter');
const safeStringify = require('fast-safe-stringify');
const qs = require('qs');
const RequestBase = require('./request-base');
const isObject = require('./is-object');
const ResponseBase = require('./response-base');
Expand Down Expand Up @@ -213,7 +214,7 @@ request.types = {
*/

request.serialize = {
'application/x-www-form-urlencoded': serialize,
'application/x-www-form-urlencoded': qs.stringify,
'application/json': safeStringify
};

Expand Down

0 comments on commit aa43b3d

Please sign in to comment.