Skip to content

Commit

Permalink
Make sure body being jsoned is fresh (#5371)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: alannnc <alannnc@gmail.com>
  • Loading branch information
3 people authored Nov 5, 2022
1 parent a8c4a9c commit 5954144
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/app-store/zoomvideo/lib/VideoApiAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ const ZoomVideoApiAdapter = (credential: CredentialPayload): VideoApiAdapter =>

const handleZoomResponse = async (response: Response, credentialId: Credential["id"]) => {
let _response = response.clone();
const responseClone = response.clone();
if (_response.headers.get("content-encoding") === "gzip") {
const responseString = await response.text();
_response = JSON.parse(responseString);
Expand All @@ -339,7 +340,7 @@ const handleZoomResponse = async (response: Response, credentialId: Credential["
throw Error(response.statusText);
}

return response.json();
return responseClone.json();
};

const invalidateCredential = async (credentialId: Credential["id"]) => {
Expand Down

0 comments on commit 5954144

Please sign in to comment.