Skip to content

Commit

Permalink
simplify req.acceptsEncodings
Browse files Browse the repository at this point in the history
  • Loading branch information
nigrosimone authored Nov 16, 2024
1 parent e5599ee commit 34b885d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,7 @@ module.exports = class Request extends Readable {
}

acceptsEncodings(...encodings) {
const accept = accepts({ headers: this.headers });
return accept.encodings(...encodings);
return accepts({ headers: this.headers }).encodings(...encodings);
}

acceptsLanguages(...languages) {
Expand Down Expand Up @@ -403,4 +402,4 @@ module.exports = class Request extends Readable {
}
return res;
}
}
}

0 comments on commit 34b885d

Please sign in to comment.