Well in another thread people were interested in what I had to change
in TurboGears controllers.py

I'm posting it under this thread, so that the issues can remain
separate.

After spending countless hours trying to get Apache configured
properly so that it wouldn't drop from https:// to http:// on
redirects, I found that I could solve this problem this way instead.

(And yes, I have ProxyPassReverse setup as recommended here and on the
TG website...no joy!  :)

I was sort of going to wait a few more days before posting this to
make sure it really worked perfectly, but it seems to work.  Now when
I'm in https and there's a redirect it stays in https...

def redirect(redirect_path, redirect_params=None, **kw):
    front_part = None
    if redirect_path.find('://') == -1 and not
redirect_path.startswith('/'):
        front_part = re.compile('r(.*?://.*/)')
    elif redirect_path.find('://') == -1:
        front_part = re.compile(r'(.*?://.*?/)')
    if front_part:
        m = front_part.match(request.headers.get("Referer", "/"))
        redirect_path = m.group(1) + redirect_path
    raise cherrypy.HTTPRedirect(
                    url(tgpath=redirect_path,
tgparams=redirect_params, **kw))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to