diff options
author | Fabian Zaremba <fabian@youremail.eu> | 2017-03-20 09:40:20 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-03-20 16:40:20 +0800 |
commit | 5586445207ac1e9b0abfba1829d326076023bd34 (patch) | |
tree | 27cf6c756038e734a7d5f1df459f5f8e61398cfd /cmd | |
parent | 9182a35f18b6d5cd981486852028e670984145c3 (diff) | |
download | gitea-5586445207ac1e9b0abfba1829d326076023bd34.tar.gz gitea-5586445207ac1e9b0abfba1829d326076023bd34.zip |
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
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/web.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cmd/web.go b/cmd/web.go index 15cec05b02..5af9ad9f2d 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) |