Skip to content

Commit

Permalink
Do not parse response body in case OK status is true
Browse files Browse the repository at this point in the history
This PR fixes redhat-developer#2514.

Signed-off-by: Denis Golovin dgolovin@redhat.com
  • Loading branch information
dgolovin committed Aug 23, 2022
1 parent 66232c4 commit 51ba5ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/openshift/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ export async function requestVerificationCode(token: string, countryCode: string
'phone_number': phoneNumber
})
});

const responseText = await verificationCodeRequestResponse.text();
return {
ok: verificationCodeRequestResponse.ok,
json: await verificationCodeRequestResponse.json() as SBResponseData
json: (responseText ? JSON.parse(responseText) : {}) as SBResponseData
}
}

Expand Down

0 comments on commit 51ba5ee

Please sign in to comment.