On Jun 28, 2012, at 3:41 AM, Manuele Pesenti wrote: > > how could it be that this controller returns two different values for url1 > and url2 if I visit the page through https? Is it correct? I was lookig a way > to distinguish in my app the protocoll used for browsing.
If you call URL(scheme=True) it uses request.env.wsgi_url_scheme as the scheme. You might take a look at what you're getting there, and also at request.is_https. In some configurations (mod_proxy, for example) web2py doesn't necessarily know the real scheme of the request. > > def test(): > url1 = URL(host=True, scheme=True) # -> http://... > url2 = request.env.http_referer # -> https://... > return locals() > > thanks a lot

