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
tokarchuk/v1.17
Fabian Zaremba 8 years ago committed by Lunny Xiao
parent 9182a35f18
commit 5586445207
  1. 3
      cmd/web.go

@ -639,6 +639,9 @@ func runWeb(ctx *cli.Context) error {
m.Get("/objects/:oid/:filename", lfs.ObjectOidHandler) m.Get("/objects/:oid/:filename", lfs.ObjectOidHandler)
m.Any("/objects/:oid", lfs.ObjectOidHandler) m.Any("/objects/:oid", lfs.ObjectOidHandler)
m.Post("/objects", lfs.PostHandler) m.Post("/objects", lfs.PostHandler)
m.Any("/*", func(ctx *context.Context) {
ctx.Handle(404, "", nil)
})
}, ignSignInAndCsrf) }, ignSignInAndCsrf)
m.Any("/*", ignSignInAndCsrf, repo.HTTP) m.Any("/*", ignSignInAndCsrf, repo.HTTP)
m.Head("/tasks/trigger", repo.TriggerTask) m.Head("/tasks/trigger", repo.TriggerTask)

Loading…
Cancel
Save