修正Content-type问题 (#135)

charset-utf-8应该为charset=utf-8,会导致部分三方优先判断Content-type错误null

Co-authored-by: liukai <liukai@quanwu.info>
This commit is contained in:
allen
2023-07-24 11:55:34 +08:00
committed by GitHub
parent ac482eb9f9
commit 70306295eb
2 changed files with 2 additions and 2 deletions

View File

@@ -223,7 +223,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
} = await (async () => {
if (stream) {
// 创建响应流
res.setHeader('Content-Type', 'text/event-stream;charset-utf-8');
res.setHeader('Content-Type', 'text/event-stream;charset=utf-8');
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Transfer-Encoding', 'chunked');
res.setHeader('X-Accel-Buffering', 'no');

View File

@@ -122,7 +122,7 @@ export const resStreamResponse = async ({
model: ChatModelType;
}) => {
// 创建响应流
res.setHeader('Content-Type', 'text/event-stream;charset-utf-8');
res.setHeader('Content-Type', 'text/event-stream;charset=utf-8');
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('X-Accel-Buffering', 'no');
res.setHeader('Cache-Control', 'no-cache, no-transform');