mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-17 16:45:02 +00:00
修正Content-type问题 (#135)
charset-utf-8应该为charset=utf-8,会导致部分三方优先判断Content-type错误null Co-authored-by: liukai <liukai@quanwu.info>
This commit is contained in:
@@ -223,7 +223,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
|
|||||||
} = await (async () => {
|
} = await (async () => {
|
||||||
if (stream) {
|
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('Access-Control-Allow-Origin', '*');
|
||||||
res.setHeader('Transfer-Encoding', 'chunked');
|
res.setHeader('Transfer-Encoding', 'chunked');
|
||||||
res.setHeader('X-Accel-Buffering', 'no');
|
res.setHeader('X-Accel-Buffering', 'no');
|
||||||
|
@@ -122,7 +122,7 @@ export const resStreamResponse = async ({
|
|||||||
model: ChatModelType;
|
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('Access-Control-Allow-Origin', '*');
|
||||||
res.setHeader('X-Accel-Buffering', 'no');
|
res.setHeader('X-Accel-Buffering', 'no');
|
||||||
res.setHeader('Cache-Control', 'no-cache, no-transform');
|
res.setHeader('Cache-Control', 'no-cache, no-transform');
|
||||||
|
Reference in New Issue
Block a user