fix: wrong response header for non streamed responses (#2606)
This commit is contained in:
parent
d579d8a45c
commit
a484315699
@ -353,7 +353,7 @@ export const chatCompletions = async (request: any, reply: any) => {
|
|||||||
reply.code(400).send(response)
|
reply.code(400).send(response)
|
||||||
} else {
|
} else {
|
||||||
reply.raw.writeHead(200, {
|
reply.raw.writeHead(200, {
|
||||||
'Content-Type': 'text/event-stream',
|
'Content-Type': request.body.stream === true ? 'text/event-stream' : 'application/json',
|
||||||
'Cache-Control': 'no-cache',
|
'Cache-Control': 'no-cache',
|
||||||
'Connection': 'keep-alive',
|
'Connection': 'keep-alive',
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user