Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[admin-api] Axios throws maxBodyLength limit error for large theme uploads #195

Closed
kevinansfield opened this issue Jan 8, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@kevinansfield
Copy link
Contributor

kevinansfield commented Jan 8, 2020

When uploading a large theme zip, the admin-api package will throw an error Error: Request body larger than maxBodyLength limit.

Reviewing some related issues (axios/axios#1985, yakovkhalinsky/backblaze-b2#45), it would appear that although axios has a default maxContentLimit of -1 which should be "limitless" that does not work for PUT/POST requests which pick up a default limit of 10MB from the underlying follow-request dependency.

From the responses in yakovkhalinsky/backblaze-b2#45 it sounds like we could try setting the axios default maxContentLength to Infinity.

@pascalandy
Copy link

Thanks for caring about this issue :)

naz pushed a commit to naz/Ghost-SDK that referenced this issue Sep 24, 2020
closes TryGhost#195

- axios' `maxContentLimit` is set to `-1` by default which is not passed through to the underlying `follow-request` library for PUT/POST requests
- setting the limit to `Infinity` allows larger requests to go through OK
naz pushed a commit to naz/Ghost-SDK that referenced this issue Sep 28, 2020
closes TryGhost#195

- axios' `maxContentLimit` is set to `-1` by default which is not passed through to the underlying `follow-request` library for PUT/POST requests
- setting the limit to `Infinity` allows larger requests to go through OK
naz pushed a commit to naz/Ghost-SDK that referenced this issue Sep 28, 2020
closes TryGhost#195

- axios' `maxContentLimit` is set to `-1` by default which is not passed through to the underlying `follow-request` library for PUT/POST requests
- setting the limit to `Infinity` allows larger requests to go through OK
naz pushed a commit that referenced this issue Apr 18, 2022
refs #195
refs axios/axios#2781

- When large theme files are uploaded to the server they sometimes fail due to a body limit error. This limit was introduced in axios http library recently. The change is similar to the one introduced in #195 for the content size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants