Skip to content

Commit

Permalink
修正Content-type问题 (labring#135)
Browse files Browse the repository at this point in the history
charset-utf-8应该为charset=utf-8,会导致部分三方优先判断Content-type错误null

Co-authored-by: liukai <liukai@quanwu.info>
  • Loading branch information
kmmao and liukai authored Jul 24, 2023
1 parent ac482eb commit 7030629
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/pages/api/openapi/v1/chat/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion client/src/service/utils/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 7030629

Please sign in to comment.