I use TG2 behind an Apache server configured as a reverse proxy and
serving pages through HTTPS. It works fine except that the use of
'redirect' function makes the redirection using HTTP. How can I force
redirect to use HTTPS ?
Currently the Apache server redirect all HTTP queries to HTTPS, so my
system is functionnal but some information are exchanged through HTTP
and I want to avoid this because :
- some information is exchanged without encryption
- there are two redirections in case redirect is used: TG2 send a
redirect to http:///some_url, then the client loads that redirection,
then the apache server tells the client to redirec to to
https://some_url, then the client can get the requested page. This is
quite heavy and useless.
Would the WSGI mode be the solution ? Do I miss something ? Is it a
"missing feature" of TG2 ?
Thanks
Damien
How exactly do you use redirect ?
Diez
> --
> You received this message because you are subscribed to the Google
> Groups "TurboGears" group.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to turbogears+...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/turbogears?hl=en
> .
>
>
Damien
from tg import expose, flash, require, url, request, redirect, validate
[...]
@expose()
@require(predicates.has_permission('AddIpAddress'))
def add_ip_address(self, new_ip_address, new_ip_address_comment="",
came_from='/home', x=0, y=0):
[...]
redirect(came_from)
Note: the form calling this controller action is like(no 'came_from' var
defined):
<form action="/action/add_ip_address">
...
</form>
Damien
[app:main] ... filter-with = proxy-prefixAnd I also added the [filter:proxy-with] section :
[filter:proxy-prefix] use = egg:PasteDeploy#prefix prefix = / scheme = https
Damien
----- Mail Original -----
De: "Damien Accorsi" <damien....@free.fr>
À: turbo...@googlegroups.com
Envoyé: Lundi 11 Janvier 2010 17h19:55 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: Re: [TurboGears] HTTPS and redirect function
Damien Accorsi wrote:
Diez B. Roggisch wrote:
--
Just a short tip if you have to do stuff like that often: there are a few
tools (sorry, can't remember the name and I'm offline right now, google
should help you) that act as web proxy which will terminate the SSL
encryption and log all traffic.
Helps debugging web traffic, much more readable than wireshark.
cheers
-- vbi
--
> Maybe that question would be a good starting point: What's the use for
> a gender field there?
Stalking.
-- Miriam Ruiz, Marco d'Itri (im that order)