This commit is contained in:
2025-09-28 14:01:30 +08:00
parent 65636782af
commit 484ce85e65

View File

@@ -136,7 +136,9 @@ func main() {
defer stream.Close() defer stream.Close()
header := c.Writer.Header() header := c.Writer.Header()
header.Set("Content-Type", "text/event-stream") header.Set("Content-Type", "text/event-stream; charset=utf-8")
header.Set("Cache-Control", "no-cache")
header.Set("Connection", "keep-alive")
if _, ok := c.Writer.(http.Flusher); !ok { if _, ok := c.Writer.(http.Flusher); !ok {
c.JSON(http.StatusInternalServerError, gin.H{"error": "streaming not supported"}) c.JSON(http.StatusInternalServerError, gin.H{"error": "streaming not supported"})