From a0058269d3c6ee92b2f9a0a5c4d6b430f1583062 Mon Sep 17 00:00:00 2001 From: Fabian Zaremba Date: Sun, 19 Mar 2017 19:47:33 +0100 Subject: [PATCH] LFS: Return 404 for unimplemented endpoints 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 d50ee62a7619c..cae9921b232ac 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -638,6 +638,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)