Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hgweb/common.py @ 17456:59a168019255
hgweb: respond 403 forbidden for ssl required error
It's preferable to report "ssl required" as an error, so that the client
can detect error and exit with 255. Currently hg exits with 1, which is
"nothing to push."
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 05 Sep 2012 23:59:27 +0900 |
parents | e34106fa0dc3 |
children | e33b9b92a200 |
line wrap: on
line diff
--- a/mercurial/hgweb/common.py Wed Sep 05 23:58:43 2012 +0900 +++ b/mercurial/hgweb/common.py Wed Sep 05 23:59:27 2012 +0900 @@ -48,7 +48,7 @@ # and replayed scheme = req.env.get('wsgi.url_scheme') if hgweb.configbool('web', 'push_ssl', True) and scheme != 'https': - raise ErrorResponse(HTTP_OK, 'ssl required') + raise ErrorResponse(HTTP_FORBIDDEN, 'ssl required') deny = hgweb.configlist('web', 'deny_push') if deny and (not user or deny == ['*'] or user in deny):