Shannon -jj Behrens wrote:
> Hmm, looks like this is what I want:
> 
> from paste.request import construct_url
> print "current url:", construct_url(request.environ)
> 
> unless there's an easier way.

This has come up before.  Should url_for have a fully_qualified keyword 
argument to do this?

> I use to have this code in Aquarium (before the WSGI days):
> 
>         if env.has_key("HTTP_X_FORWARDED_HOST"):
>             host = env["HTTP_X_FORWARDED_HOST"]
> 
> That is, if there is a X_FORWARDED_HOST header, use that as your HOST
> header.  That way, the proxy issues go away.

This could potentially go in PrefixMiddleware, as another kind of fixup 
of an incoming proxied request.

It's occurred to me that really proxies could (and should) just retain 
the original Host header.  But the kind of proxying people do for web 
frameworks never does.  Why is that?

-- 
Ian Bicking | [EMAIL PROTECTED] | http://blog.ianbicking.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to