Skip to content

Commit

Permalink
return buffer when content-type starts with image/
Browse files Browse the repository at this point in the history
  • Loading branch information
Emile Nijssen committed Sep 15, 2023
1 parent 0f58b7f commit 3d7a200
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/OAuth2Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,8 @@ class OAuth2Client extends EventEmitter {
if (typeof contentType === 'string') {
if (contentType.startsWith('application/json')) {
body = await response.json();
} else if (contentType.startsWith('image/')) {
body = await response.buffer();
} else {
body = await response.text();
}
Expand Down

0 comments on commit 3d7a200

Please sign in to comment.