Skip to content

Commit

Permalink
fix: use res.arrayBuffer() instead of res.buffer() (#624)
Browse files Browse the repository at this point in the history
This fixes a DeprecationWarning when using git node wpt.
  • Loading branch information
Alicia Lopez committed Apr 25, 2022
1 parent a6ea773 commit 5d32ca4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export default class Request {
}

async buffer(url, options = {}) {
return this.fetch(url, options).then(res => res.buffer());
const res = await this.fetch(url, options);
const buffer = await res.arrayBuffer();
return Buffer.from(buffer);
}

async text(url, options = {}) {
Expand Down

0 comments on commit 5d32ca4

Please sign in to comment.