Skip to content

Commit 95689f7

Browse files
committed
[DE-605] Always use POST for cursors
1 parent e4c1279 commit 95689f7

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ This driver uses semantic versioning:
1818

1919
### Changed
2020

21+
- Fetching additional cursor results now uses `POST` instead of `PUT` (DE-605)
22+
23+
The `POST` route was deprecated and the `PUT` route is supported in all
24+
actively maintained versions of ArangoDB.
25+
2126
- User management methods now use database-relative URLs (DE-606)
2227

2328
Previously these methods would make requests without a database prefix,

src/cursor.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -214,17 +214,10 @@ export class BatchedArrayCursor<T = any> {
214214
protected async _more(): Promise<void> {
215215
if (!this._id || !this.hasMore) return;
216216
const body = await this._db.request({
217-
...(this._nextBatchId
218-
? {
219-
method: "POST",
220-
path: `/_api/cursor/${encodeURIComponent(this._id)}/${
221-
this._nextBatchId
222-
}`,
223-
}
224-
: {
225-
method: "PUT",
226-
path: `/_api/cursor/${encodeURIComponent(this._id)}`,
227-
}),
217+
method: "POST",
218+
path: this._nextBatchId
219+
? `/_api/cursor/${encodeURIComponent(this._id)}/${this._nextBatchId}`
220+
: `/_api/cursor/${encodeURIComponent(this._id)}`,
228221
hostUrl: this._hostUrl,
229222
allowDirtyRead: this._allowDirtyRead,
230223
});

0 commit comments

Comments
 (0)