Skip to content

Commit

Permalink
fix: fix xunfei crash (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
glzjin authored Aug 20, 2023
1 parent 05e4f2b commit efeb9a1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controller/relay-text.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,11 @@ func relayTextHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode {
return errorWrapper(err, "close_request_body_failed", http.StatusInternalServerError)
}
isStream = isStream || strings.HasPrefix(resp.Header.Get("Content-Type"), "text/event-stream")
}

if resp.StatusCode != http.StatusOK {
return errorWrapper(
fmt.Errorf("bad status code: %d", resp.StatusCode), "bad_status_code", resp.StatusCode)
if resp.StatusCode != http.StatusOK {
return errorWrapper(
fmt.Errorf("bad status code: %d", resp.StatusCode), "bad_status_code", resp.StatusCode)
}
}

var textResponse TextResponse
Expand Down

0 comments on commit efeb9a1

Please sign in to comment.