mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 10:26:53 +02:00
server: send 405 instead of 404 for unallowed methods (#10275)
Fixes: #5483
This commit is contained in:
parent
92ce438de0
commit
4090aca97b
2 changed files with 11 additions and 0 deletions
|
@ -1170,6 +1170,7 @@ func (s *Server) GenerateRoutes(rc *ollama.Registry) (http.Handler, error) {
|
|||
corsConfig.AllowOrigins = envconfig.AllowedOrigins()
|
||||
|
||||
r := gin.Default()
|
||||
r.HandleMethodNotAllowed = true
|
||||
r.Use(
|
||||
cors.New(corsConfig),
|
||||
allowedHostsMiddleware(s.addr),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue