Commit c9866943 authored by Michael Yang's avatar Michael Yang
Browse files

fix HEAD / request

HEAD request should respond like their GET counterparts except without a
response body.
parent 058d0cd0
......@@ -543,12 +543,11 @@ func Serve(ln net.Listener, allowOrigins []string) error {
},
)
r.GET("/", func(c *gin.Context) {
for _, method := range []string{http.MethodGet, http.MethodHead} {
r.Handle(method, "/", func(c *gin.Context) {
c.String(http.StatusOK, "Ollama is running")
})
r.HEAD("/", func(c *gin.Context) {
c.Status(http.StatusOK)
})
}
r.POST("/api/pull", PullModelHandler)
r.POST("/api/generate", GenerateHandler)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment