twisted.web2.vhost and X-Forwarded-For (was Re: [Twisted-web] Cheetah+twisted.web2

David Reid dreid at
Thu Jan 19 14:59:28 MST 2006

Hash: SHA1

Andrea Arcangeli wrote:
> On Thu, Jan 19, 2006 at 09:24:01AM -0800, David Reid wrote:
>> Judging from the way Request actually deals with .uri it should be _uri, 
>> I'll discuss this with foom and fix it later.
> So you mean, it should be private? But then how can the vhost fixup the
> uri if it's private?

well uri actually gets parsed out to all the things that VHostURIRewrite
 assigns to.  What is more likely to happen in the next few days is
request.uri will become a URI object and req.path, req.scheme,,
req.port etc will all be provided instead by req.uri.scheme etc ...
This way assigning something to req.uri will make sense and actually
affect things.  Currently nothing important actually happens if you
assign to request.uri (because by the time we get to user code we've
already parsed out all the useful bits)

> There are large ISP that I assume log the stuff properly.

You know what they say about assumptions. :)

>> I'm not sure if tacking a :port onto the X-Forwarded-For header will 
>> break other http servers.
> I don't know. Should I use a x-forwarded-port instead?

probably X-Forwarded-For-Port or something.  I'm not sure, I was kinda
hoping someone else could give some input.

>> Send me a patch (on or offlist) that changes chanRequest to _chanRequest[1]
> What do you mean exactly with [1]? And why only one "_" I thought two __
> were needed to make it private. Or you want it only as an hint?

[1] indicates a footnote, which could be found after my name (I probably
should have
put it before my name it was meant to indicate that you should read the
Twisted coding standards and that this document would explain why '_'
instead of '__'.

- -David
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


More information about the Twisted-web mailing list