[PATCH 2 of 2] hgweb: send HTTP unauthorized error when pulling denied via allowpull setting

Mark Edgington edgimar at gmail.com
Fri Jan 2 18:34:06 CST 2009


# HG changeset patch
# User Mark Edgington <edgimar at gmail.com>
# Date 1226262707 -3600
# Node ID 3469af1ae8555b17eb21714691b06c3c2198d170
# Parent  402f5fddd67235a50b6a5b2bd7f997ba6d73d9cf
hgweb: send HTTP unauthorized error when pulling denied via allowpull setting

diff -r 402f5fddd672 -r 3469af1ae855 mercurial/hgweb/hgweb_mod.py
--- a/mercurial/hgweb/hgweb_mod.py	Sun Nov 09 21:29:29 2008 +0100
+++ b/mercurial/hgweb/hgweb_mod.py	Sun Nov 09 21:31:47 2008 +0100
@@ -289,7 +289,7 @@
             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


More information about the Mercurial-devel mailing list