Skip to content

Commit

Permalink
fix: re-introduce paramsSerializer
Browse files Browse the repository at this point in the history
  • Loading branch information
ruderngespra committed Nov 17, 2023
1 parent fd2345d commit 941962d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"fast-copy": "^2.1.7",
"lodash.isplainobject": "^4.0.6",
"lodash.isstring": "^4.0.1",
"p-throttle": "^4.1.1"
"p-throttle": "^4.1.1",
"qs": "^6.11.2"
},
"devDependencies": {
"@babel/cli": "^7.12.8",
Expand All @@ -65,6 +66,7 @@
"@types/jest": "^29.2.2",
"@types/lodash.isplainobject": "^4.0.6",
"@types/lodash.isstring": "^4.0.6",
"@types/qs": "^6.9.10",
"@typescript-eslint/eslint-plugin": "^5.11.0",
"@typescript-eslint/parser": "^5.11.0",
"axios": "^1.6.0",
Expand Down
6 changes: 6 additions & 0 deletions src/create-http-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { AxiosRequestHeaders } from 'axios'
import type { AxiosStatic } from 'axios'
import copy from 'fast-copy'
import asyncToken from './async-token'
import qs from 'qs'

import rateLimitRetry from './rate-limit'
import rateLimitThrottle from './rate-limit-throttle'
Expand Down Expand Up @@ -94,6 +95,11 @@ export default function createHttpClient(
adapter: config.adapter,
maxContentLength: config.maxContentLength,
maxBodyLength: config.maxBodyLength,
paramsSerializer: {
serialize: (params) => {
return qs.stringify(params)
},
},
// Contentful
logHandler: config.logHandler,
responseLogger: config.responseLogger,
Expand Down

0 comments on commit 941962d

Please sign in to comment.