Skip to content

Commit

Permalink
Merge pull request #4 from MrDgbot/main
Browse files Browse the repository at this point in the history
Fix the json request
  • Loading branch information
ljnchn authored Jan 25, 2024
2 parents 238fa0b + df11a44 commit 906716b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type ModelList struct {
Data []Model `json:"data"`
}

var version = "v0.4"
var version = "v0.5"
var port = "8081"

func main() {
Expand Down Expand Up @@ -179,14 +179,15 @@ func forwardRequest(c *gin.Context) {
return
}

c.Header("Content-Type", "application/json; charset=utf-8")

if isStream {
c.Header("Content-Type", "text/event-stream; charset=utf-8")
returnStream(c, resp)
} else {
returnJson(c, resp)
}

c.Header("Content-Type", "text/event-stream; charset=utf-8")

// 创建一个新的扫描器
scanner := bufio.NewScanner(resp.Body)

Expand Down

0 comments on commit 906716b

Please sign in to comment.