Commit 9c5bc512 by JustSong

fix: add X-Accel-Buffering header on SSE response

parent 6c318858
...@@ -262,6 +262,7 @@ func relayHelper(c *gin.Context) *OpenAIErrorWithStatusCode { ...@@ -262,6 +262,7 @@ func relayHelper(c *gin.Context) *OpenAIErrorWithStatusCode {
c.Writer.Header().Set("Cache-Control", "no-cache") c.Writer.Header().Set("Cache-Control", "no-cache")
c.Writer.Header().Set("Connection", "keep-alive") c.Writer.Header().Set("Connection", "keep-alive")
c.Writer.Header().Set("Transfer-Encoding", "chunked") c.Writer.Header().Set("Transfer-Encoding", "chunked")
c.Writer.Header().Set("X-Accel-Buffering", "no")
c.Stream(func(w io.Writer) bool { c.Stream(func(w io.Writer) bool {
select { select {
case data := <-dataChan: case data := <-dataChan:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment