Skip to content

Commit 69b1387

Browse files
Fix iterator bug for uploading new file versions (#531)
1 parent cf5cb05 commit 69b1387

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Next Release
4+
5+
- Fix iterator bug for uploading new file versions ([#531](https://github.com/box/box-node-sdk/pull/531))
6+
37
## 1.34.0 [2020-08-04]
48

59
- Add zip functionality ([#525](https://github.com/box/box-node-sdk/pull/525))

lib/util/paging-iterator.js

+3
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ class PagingIterator {
160160
if (response.request.method === 'GET') {
161161
this.options.qs[this.nextField] = this.nextValue;
162162
} else if (response.request.method === 'POST') {
163+
if (!this.options.body) {
164+
this.options.body = {};
165+
}
163166
this.options.body[this.nextField] = this.nextValue;
164167
let bodyString = JSON.stringify(this.options.body);
165168
this.options.headers['content-length'] = bodyString.length;

0 commit comments

Comments
 (0)