浏览代码

use content type `application/x-ndjson` for streaming responses

Jeffrey Morgan 1 年之前
父节点
当前提交
cff002b824
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      server/routes.go

+ 1 - 0
server/routes.go

@@ -367,6 +367,7 @@ func Serve(ln net.Listener, extraOrigins []string) error {
 }
 
 func streamResponse(c *gin.Context, ch chan any) {
+	c.Header("Content-Type", "application/x-ndjson")
 	c.Stream(func(w io.Writer) bool {
 		val, ok := <-ch
 		if !ok {