Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 03b4b70

Browse files
authoredApr 25, 2022
fix: use res.arrayBuffer() instead of res.buffer() (#624)
This fixes a DeprecationWarning when using git node wpt.
1 parent 1bcc72b commit 03b4b70

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎lib/request.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export default class Request {
3737
}
3838

3939
async buffer(url, options = {}) {
40-
return this.fetch(url, options).then(res => res.buffer());
40+
const res = await this.fetch(url, options);
41+
const buffer = await res.arrayBuffer();
42+
return Buffer.from(buffer);
4143
}
4244

4345
async text(url, options = {}) {

0 commit comments

Comments
 (0)
Please sign in to comment.