Skip to content

Commit

Permalink
feat: include maxBodyLength in axios config
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Bianconi committed May 5, 2021
1 parent c1b0a03 commit 9c69b6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/create-http-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default function createHttpClient(
basePath: '',
adapter: undefined,
maxContentLength: 1073741824, // 1GB
maxBodyLength: 1073741824, // 1GB
}
const config = {
...defaultConfig,
Expand Down Expand Up @@ -102,6 +103,7 @@ export default function createHttpClient(
timeout: config.timeout,
adapter: config.adapter,
maxContentLength: config.maxContentLength,
maxBodyLength: config.maxBodyLength,
// Contentful
logHandler: config.logHandler,
responseLogger: config.responseLogger,
Expand Down
6 changes: 6 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,10 @@ export type CreateHttpClientParams = {
* @default 1073741824 i.e 1GB
*/
maxContentLength?: number

/**
* Optional maximum body length in bytes
* @default 1073741824 i.e 1GB
*/
maxBodyLength?: number
}

0 comments on commit 9c69b6c

Please sign in to comment.