Make sure body being jsoned is fresh (#5371)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: alannnc <alannnc@gmail.com>
This commit is contained in:
authored and GitHub committed 2022-11-05 18:13:34 +00:00
1 parent a8c4a9c4c2
commit 5954144b98
1 file changed
+2 -1
@@ -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);
@@ -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"]) => {