From 5586445207ac1e9b0abfba1829d326076023bd34 Mon Sep 17 00:00:00 2001 From: Fabian Zaremba Date: Mon, 20 Mar 2017 09:40:20 +0100 Subject: [PATCH] LFS: Return 404 for unimplemented endpoints (#1330) Without this patch a 401 is returned for unspecified endpoints, making the LFS client ask for HTTP credentials. This behaviour was introduced with the new locking API: https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md --- cmd/web.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/web.go b/cmd/web.go index 15cec05b0..5af9ad9f2 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -639,6 +639,9 @@ func runWeb(ctx *cli.Context) error { m.Get("/objects/:oid/:filename", lfs.ObjectOidHandler) m.Any("/objects/:oid", lfs.ObjectOidHandler) m.Post("/objects", lfs.PostHandler) + m.Any("/*", func(ctx *context.Context) { + ctx.Handle(404, "", nil) + }) }, ignSignInAndCsrf) m.Any("/*", ignSignInAndCsrf, repo.HTTP) m.Head("/tasks/trigger", repo.TriggerTask)