[PATCH] Make {urlbase} work in templates when https is used

Thomas Arendsen Hein thomas at intevation.de
Thu Jul 12 07:45:48 CDT 2007


* Wesley J. Landaker <wjl at icecavern.net> [20070711 22:56]:
> On Wednesday 11 July 2007 05:10:47 Thomas Arendsen Hein wrote:
> > I guess we could split out SSL detection into a separate function
> > and fix it after that.
> 
> Here are some thoughts I had. I see two separate issues where we want to 
> detect SSL, and these should probably be re-factored into one place.
> 
>   * Determining if SSL (or, in the future, TLS) is being used, for purposes 
> of deciding if something is allowed (e.g. doing authentication). This 
> should probably be done in one place, using various good heuristics, like 
> seeing if the HTTPS (or other?) environment variables are set to certain 
> things, using internally set flags from "hg serve", looking at wsgi 
> parameters, etc.

Absolutely yes :)

>   * Determining what the protocol for generated URLs should look like for 
> templates, say for instance so that the web interface, RSS feeds, etc, 
> point to the correct URL. This should by default be autodetected by looking 
> at the above (e.g. if SSL is enabled, assume "https", since HTTP+TLS isn't 
> common yet), but should also be settable via a config option, so you can do 
> things like run http behind an https proxy, etc. (This part of things I was 
> very partially addressing in the patch that's the subject of this thread.)

This should not be overdesigned, currently we only have http and
https and we don't know what needs we will have in the future.

> What do you guys think about that? I'm not totally volunteering to do all 
> the work =), but I may have time to work towards a patchset that's on the 
> right track if there is some agreement about how this should work.

A patch for the first would be a very good start.

Thomas

-- 
thomas at intevation.de - http://intevation.de/~thomas/ - OpenPGP key: 0x5816791A
Intevation GmbH, Osnabrueck - Register: Amtsgericht Osnabrueck, HR B 18998
Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial-devel/attachments/20070712/0fc79d1f/attachment.pgp 


More information about the Mercurial-devel mailing list