diff options
author | Peter Smit <peter@smitmail.eu> | 2015-02-16 12:00:06 +0200 |
---|---|---|
committer | Peter Smit <peter@smitmail.eu> | 2015-02-16 12:00:06 +0200 |
commit | f9454cc32c94780eb4c49753fc0ccd9b60b1deb7 (patch) | |
tree | a16185c28567718c97de6174bd075a28fe8bb1e2 /routers | |
parent | cd6a2b78a752605d808c6392ce78b92d4759fede (diff) | |
download | gitea-f9454cc32c94780eb4c49753fc0ccd9b60b1deb7.tar.gz gitea-f9454cc32c94780eb4c49753fc0ccd9b60b1deb7.zip |
Make sure that a mirror can't be written to by http or ssh
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/http.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go index 034b5a7b5e..d47d73ef05 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -158,6 +158,11 @@ func Http(ctx *middleware.Context) { return } } + + if !isPull && repo.IsMirror { + ctx.Handle(401, "can't push to mirror", nil) + return + } } } |