Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Pilar <[email protected]>
  • Loading branch information
Tomas Pilar committed Jan 11, 2024
1 parent fa16dc8 commit e1c9fe0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/api/streaming-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ export function createStreamingApiClient(clientOptions: {
method: 'POST',
body: JSON.stringify(body),
headers: Object.fromEntries(
(mergeHeaders(clientOptions.headers, headers, {
mergeHeaders(clientOptions.headers, headers, {
'Content-Type': 'application/json',
}) as any), // Types are incomplete, support is there in Node 18 https://developer.mozilla.org/en-US/docs/Web/API/Headers
}) as any, // Types are incomplete, support is there in Node 18 https://developer.mozilla.org/en-US/docs/Web/API/Headers
),
signal: delegatedController.signal,
onclose: onClose,
Expand All @@ -85,7 +85,7 @@ export function createStreamingApiClient(clientOptions: {

const responseData = contentType.startsWith('application/json')
? await response.json().catch(() => null)
: null;
: await response.text();

onError(new HttpError(responseData));
},
Expand Down

0 comments on commit e1c9fe0

Please sign in to comment.