fix HEAD / request
HEAD request should respond like their GET counterparts except without a response body.
This commit is contained in:
parent
058d0cd04b
commit
c986694367
1 changed files with 5 additions and 6 deletions
|
@ -543,12 +543,11 @@ func Serve(ln net.Listener, allowOrigins []string) error {
|
|||
},
|
||||
)
|
||||
|
||||
r.GET("/", func(c *gin.Context) {
|
||||
c.String(http.StatusOK, "Ollama is running")
|
||||
})
|
||||
r.HEAD("/", func(c *gin.Context) {
|
||||
c.Status(http.StatusOK)
|
||||
})
|
||||
for _, method := range []string{http.MethodGet, http.MethodHead} {
|
||||
r.Handle(method, "/", func(c *gin.Context) {
|
||||
c.String(http.StatusOK, "Ollama is running")
|
||||
})
|
||||
}
|
||||
|
||||
r.POST("/api/pull", PullModelHandler)
|
||||
r.POST("/api/generate", GenerateHandler)
|
||||
|
|
Loading…
Reference in a new issue