mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
fix: buffer not return event show errors (#149)
This commit is contained in:
parent
54a6571462
commit
2d0d3365ed
|
@ -78,7 +78,7 @@ const handleStream = (response: any, onData: IOnData, onCompleted?: IOnCompleted
|
||||||
if (message.startsWith('data: ')) { // check if it starts with data:
|
if (message.startsWith('data: ')) { // check if it starts with data:
|
||||||
// console.log(message);
|
// console.log(message);
|
||||||
bufferObj = JSON.parse(message.substring(6)) // remove data: and parse as json
|
bufferObj = JSON.parse(message.substring(6)) // remove data: and parse as json
|
||||||
if (bufferObj.status === 400) {
|
if (bufferObj.status === 400 || !bufferObj.event) {
|
||||||
onData('', false, {
|
onData('', false, {
|
||||||
conversationId: undefined,
|
conversationId: undefined,
|
||||||
messageId: '',
|
messageId: '',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user