Merge branch 'main' of https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web
This commit is contained in:
commit
50783987d4
|
@ -101,6 +101,7 @@ async function handle(
|
||||||
authorization: req.headers.get("authorization") ?? "",
|
authorization: req.headers.get("authorization") ?? "",
|
||||||
},
|
},
|
||||||
body: shouldNotHaveBody ? null : req.body,
|
body: shouldNotHaveBody ? null : req.body,
|
||||||
|
redirect: 'manual',
|
||||||
method,
|
method,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
duplex: "half",
|
duplex: "half",
|
||||||
|
|
|
@ -151,6 +151,9 @@ export class ChatGPTApi implements LLMApi {
|
||||||
if (finished || controller.signal.aborted) {
|
if (finished || controller.signal.aborted) {
|
||||||
responseText += remainText;
|
responseText += remainText;
|
||||||
console.log("[Response Animation] finished");
|
console.log("[Response Animation] finished");
|
||||||
|
if (responseText?.length === 0) {
|
||||||
|
options.onError?.(new Error("empty response from server"));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue