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

Allow setting the option maxBodyLength on putFileContents() #220

Merged
merged 2 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion source/factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const NOOP = () => {};
* Options for creating a resource
* @typedef {UserOptions} PutOptions
* @property {Boolean=} overwrite - Whether or not to overwrite existing files (default: true)
* @property {Number=} maxContentLength - The maximum amount of bytes to upload (default: 10 MiB)
* @property {Number=} maxContentLength - The maximum amount of bytes to download (default: 10 MiB)
* @property {Number=} maxBodyLength - The maximum amount of bytes to upload (default: 10 MiB) (only in nodejs-environments)
*/

/**
Expand Down
3 changes: 3 additions & 0 deletions source/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ function prepareRequestOptions(requestOptions, methodOptions) {
if (methodOptions.maxContentLength) {
requestOptions.maxContentLength = methodOptions.maxContentLength;
}
if (methodOptions.maxBodyLength) {
requestOptions.maxBodyLength = methodOptions.maxBodyLength;
}
if (methodOptions.onUploadProgress && typeof methodOptions.onUploadProgress === "function") {
requestOptions.onUploadProgress = methodOptions.onUploadProgress;
}
Expand Down