Sure Luis, sorry for the confusion...
I have my website using minimal URL's (without index.cfm in the URL)
like:
http://localhost/home/about
I've also enabled the ssl interceptor, using a pattern of ^(security|
admin>user)
This works as expected, the events that match the pattern are all
redirected to https:// (if needed), and the events that don't match
are redirected to http:// (if needed).
The one case where this doesn't work is form post like on the login
page. When the 'login' link is clicked, it matches the security
pattern, so the login URL is:
https://localhost/security/login
The action for the login form looks like:
<form name="Login" method="post" action="#event.buildLink
('security.dologin')#">
OR
<form name="Login" method="post" action="/security/dologin">
The problem is that the post link is converted to a non secure link:
http://localhost/security/dologin
Now, I know I can set the event.setsesbaseurl() on a per request
basis, but if I have a lot of handlers, I need to remember to
setsesbaseurl() in each handler so it matches the regex for the SSL
interceptor?
What I want(ed) to do is make the Routes.cfm file smarter, so that if
SSL is required, the setBaseURL is updated automatically.
Something like the following would be ideal...
// Base URL
if( isSSLRequired(event) ){
setBaseURL("https://#cgi.HTTP_HOST#");
}
else{
setBaseURL("http://#cgi.HTTP_HOST#");
}