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
This commit is contained in:
Fabian Zaremba 2017-03-20 09:40:20 +01:00 committed by Lunny Xiao
parent 9182a35f18
commit 5586445207

View file

@ -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)