Re: [Repoze-dev] Generating http/https links from the application

2010-11-10 Thread Daniel Holth
Paste's own PrefixMiddleware interprets X-Forwarded- headers, as I discovered when I was trying to figure out why in the world the X-Forwarded- headers weren't making it to my application. From the docstring: Also, unless disabled, the ``X-Forwarded-Server`` header will be translated to th

Re: [Repoze-dev] Generating http/https links from the application

2010-11-10 Thread Chris Rossi
I would just have a middleware look for that header and rewrite wsgi.url_scheme appropriately in the environment. You could use repoze.vhm to do that, but since you only need that one tweak, a few lines of middleware should really be all you need. Chris class RewriteURLSchemeMiddleware(object):

[Repoze-dev] Generating http/https links from the application

2010-11-10 Thread Hanno Schlichting
Hi. We have an application which supports both HTTP and HTTPS. If the user visits the site via https:// he should stay on that protocol and as such all links should be generated accordingly. We do the SSL handling in Nginx in front of the bfg application. So the application always gets a request.