fix: fix "[DONE is not valid JSON" (#57)

This commit is contained in:
JustSong 2023-05-14 12:48:42 +08:00
parent 2edd52e851
commit 246b981e23

View File

@ -210,7 +210,7 @@ func relayHelper(c *gin.Context) error {
select {
case data := <-dataChan:
if strings.HasPrefix(data, "data: [DONE]") {
data = data[:len(data)-1]
data = "data: [DONE]"
}
c.Render(-1, common.CustomEvent{Data: data})
return true