Open leadscloud opened 1 month ago
Please follow the issue template to update title and description of your issue.
Bot detected the issue body's language is not English, translate it automatically.
Title: interface. If 201 is returned instead of 200, unexpected situations will occur.
if (
!res.ok ||
!res.headers
.get("content-type")
?.startsWith(EventStreamContentType) ||
res.status !== 200
) {
For example, in nestjs, the default value returned by the post interface is 201, but the above judgment is 200, which causes the normal stream content to be displayed directly in the source content format, causing an error.
It is recommended that this logic be modified. 201 is also the res.ok
Thank you for your feedback, we will adopt the suggestion
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/blob/da2e2372aa8490deee3fb50bd01dbdd9ca3f1dba/app/client/platforms/openai.ts#L216
诸如nestjs中,post接口返回的默认是201,但以上判断是200,导致正常的stream内容直接以源内容格式显示,导致错误。
建议这个逻辑修改下。201也是res.ok