diff --git a/controller/channel-test.go b/controller/channel-test.go index 4625b576..0469019a 100644 --- a/controller/channel-test.go +++ b/controller/channel-test.go @@ -55,6 +55,10 @@ func testChannel(channel *model.Channel, request ChatRequest) error { return err } + if resp.StatusCode != 200 { + return errors.New("invalid status code: " + strconv.Itoa(resp.StatusCode)) + } + var response TextResponse isStream := strings.HasPrefix(resp.Header.Get("Content-Type"), "text/event-stream") var streamResponseText string diff --git a/main.go b/main.go index 4447509d..6fd55f8d 100644 --- a/main.go +++ b/main.go @@ -23,7 +23,7 @@ var buildFS embed.FS var indexPage []byte func main() { - godotenv.Load() + godotenv.Load(".env") common.SetupGinLog() common.SysLog("One API " + common.Version + " started")