# HG changeset patch # User Mark Edgington # Date 2009-01-03 19:50:06 # Node ID bbcd2dea19fef832dbcb4c7a4f0b085d1ee50c2a # Parent b663b5563de701ff2740d1400c27d262087678d7 hgweb: send HTTP unauthorized error when denying pull diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -289,7 +289,7 @@ class hgweb(object): raise ErrorResponse(HTTP_UNAUTHORIZED, 'read not authorized') if op == 'pull' and not self.allowpull: - raise ErrorResponse(HTTP_OK, '') + raise ErrorResponse(HTTP_UNAUTHORIZED, 'pull not authorized') # op is None when checking allow/deny_read permissions for a web-browser request elif op == 'pull' or op is None: return diff --git a/tests/test-pull-http.out b/tests/test-pull-http.out --- a/tests/test-pull-http.out +++ b/tests/test-pull-http.out @@ -2,11 +2,11 @@ adding a updating working directory 1 files updated, 0 files merged, 0 files removed, 0 files unresolved % expect error, cloning not allowed -abort: error: +abort: authorization failed requesting all changes % serve errors % expect error, pulling not allowed -abort: error: +abort: authorization failed pulling from http://localhost/ searching for changes % serve errors