1
0

proper headers

This commit is contained in:
Antonio Cheong 2023-04-06 10:00:42 +08:00
parent f54f15f791
commit a7c588549d

View File

@ -94,6 +94,13 @@ func nightmare(c *gin.Context) {
var fulltext string
// Read the response byte by byte until a newline character is encountered
if chat_request.Stream {
// Response content type is text/event-stream
c.Header("Content-Type", "text/event-stream")
} else {
// Response content type is application/json
c.Header("Content-Type", "application/json")
}
for {
line, err := reader.ReadString('\n')
if err != nil {