box-node-sdk 1.34.1 → 1.34.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/lib/util/paging-iterator.js +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.34.2 [2020-08-20]
|
|
4
|
+
|
|
5
|
+
- Make iterator bug fix for uploading files non breaking ([#534](https://github.com/box/box-node-sdk/pull/534))
|
|
6
|
+
|
|
3
7
|
## 1.34.1 [2020-08-17]
|
|
4
8
|
|
|
5
9
|
- Fix iterator bug for uploading new file versions ([#531](https://github.com/box/box-node-sdk/pull/531))
|
|
@@ -58,7 +58,11 @@ class PagingIterator {
|
|
|
58
58
|
* @returns {boolean} Whether the response is iterable
|
|
59
59
|
*/
|
|
60
60
|
static isIterable(response) {
|
|
61
|
-
|
|
61
|
+
// POST responses for uploading a file are explicitly excluded here because, while the response is iterable,
|
|
62
|
+
// it always contains only a single entry and historically has not been handled as iterable in the SDK.
|
|
63
|
+
// This behavior is being preserved here to avoid a breaking change.
|
|
64
|
+
let UPLOAD_PATTERN = /.*upload\.box\.com.*\/content/;
|
|
65
|
+
var isGetOrPostRequest = (response.request && (response.request.method === 'GET' || (response.request.method === 'POST' && !UPLOAD_PATTERN.test(response.request.uri.href)))),
|
|
62
66
|
hasEntries = (response.body && Array.isArray(response.body.entries)),
|
|
63
67
|
notEventStream = (response.body && !response.body.next_stream_position);
|
|
64
68
|
|