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

Andrea Arcangeli andrea at
Thu Jan 19 15:32:06 MST 2006

On Thu, Jan 19, 2006 at 01:59:28PM -0800, David Reid wrote:
> 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

Will prepath/postpath go there too?

> 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)

Yep. The only place where request.uri was needed, was is in the log. The
log was screwed without my own patching of req.uri (the same way you
also patched req.path). The log is the only reason I've changed the uri.

> You know what they say about assumptions. :)

Well, then in the unlikely case they log, and in the unlikely case that
there's a legal inquiry, they would then require me to know the port ;).

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

Looks good to me.

> >> 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

Oh well that was fun... sorry for not noticing the footnote (I mistaken it
for a mailing list signature).

More information about the Twisted-web mailing list