Skip to content

Commit

Permalink
fix: add text to responseType switch statement (#554)
Browse files Browse the repository at this point in the history
* fix: add text to responseType switch statement

* Update common.ts

* Update common.ts

fix lint

---------

Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com>
  • Loading branch information
ddelgrosso1 and sofisl committed Jul 20, 2023
1 parent 1c7f23f commit 899cf1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ function translateData(responseType: string | undefined, data: any) {
return JSON.parse(Buffer.from(data).toString('utf8'));
case 'blob':
return JSON.parse(data.text());
case 'text':
return JSON.parse(data.text());
default:
return data;
}
Expand Down
2 changes: 2 additions & 0 deletions src/gaxios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ export class Gaxios {
return res.arrayBuffer();
case 'blob':
return res.blob();
case 'text':
return res.text();
default:
return this.getResponseDataFromContentType(res);
}
Expand Down

0 comments on commit 899cf1f

Please sign in to comment.