mirror of
https://github.com/ollama/ollama.git
synced 2025-11-11 10:47:13 +01:00
server: send 405 instead of 404 for unallowed methods (#10275)
Fixes: #5483
This commit is contained in:
@@ -485,6 +485,16 @@ func TestRoutes(t *testing.T) {
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "Method Not Allowed",
|
||||
Method: http.MethodGet,
|
||||
Path: "/api/show",
|
||||
Expected: func(t *testing.T, resp *http.Response) {
|
||||
if resp.StatusCode != 405 {
|
||||
t.Errorf("expected status code 405, got %d", resp.StatusCode)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
modelsDir := t.TempDir()
|
||||
|
||||
Reference in New Issue
Block a user