fix content-type = text/event-stream;charset=utf-8

This commit is contained in:
kirk.shan 2023-05-18 10:25:06 +08:00
parent 62ad7e5ad3
commit 789f3d993c
1 changed files with 3 additions and 1 deletions

View File

@ -99,7 +99,9 @@ export class ChatGPTApi implements LLMApi {
if (
!res.ok ||
res.headers.get("content-type") !== EventStreamContentType ||
!res.headers
.get("content-type")
?.startsWith(EventStreamContentType) ||
res.status !== 200
) {
const responseTexts = [responseText];