[PATCH 0 of 1] Patch to fix a small "bug" and improve support for custom auth extensions.

Sune Foldager cryo at cyanite.org
Sat Feb 7 11:47:44 UTC 2009


I forgot to mention; patched crew and my queue can be accessed here: http://cyanite.org/hg/

-- Sune

On 07/02/2009, at 12.44, Sune Foldager <cryo at cyanite.org> wrote:

> This patch does two things, both minor and both have no effect on  
> existing functionality.
>
> 1. Fixes a small "bug" in hgweb/hgweb_mod.py:
>   The request.response function accepts ErrorResponse instances, but  
> the two places in hgweb_mod.py where
>   such instances are caught and request.respond is called, the  
> instance is unwrapped instead of just passed
>   along. I fixed that (by removing '.code' from two places,  
> basically). Less code, same function :-).
> 2. Extends the ErrorResponse class with a 'headers' argument to the  
> constuctor. This allows for ErrorResponses
>   with additional HTTP headers. It's not used by mercurial, but  
> extensions might use it.
>
> So why do this? Well, I have an extension (actually a patch right  
> now) which wraps check_perms and does some
> custom authorization. For that I need to send back 401 challenges.  
> With this patch it's as simple as raising
> an ErrorResponse with the correct WWW-Authenticate header :-).
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list