Quantcast

HTTPS routing suddenly stopped working in Grails

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

HTTPS routing suddenly stopped working in Grails

sshehab

In my Grails 2.5.1 application , i was using a filter to use HTTPS with some controllers , everything was working fine but suddenly this filter is not working any more .

Filter :


def filters = {
    all(controller:'checkout', action:'onlinePayment') {
        before = {

            if (!request.isSecure() /*&& !Environment.isDevelopmentMode()*/) {
                def url = "https://" + request.serverName+':8443' + request.forwardURI
                println "in filter"
                redirect(url: url, permanent: true)
                return false
            }
        }
        after = { Map model ->
        }
        afterView = { Exception e ->
        }
    }
}


Here is the checkout page :


is there something i need to check to fix this issue ?


Thanks


--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/b9380dad-287e-4fb6-98be-ba3a83eb803c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Thanks Sherif
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: HTTPS routing suddenly stopped working in Grails

bond_
Hmm, never heard of this ever before generally people do it like this.

Web Server (for ex: Apache HTTP server or nginx) ==> Application server (for ex: Tomcat)

These redirect rules are actually configured in Web Server layer. By the way I think this should go into stackoverflow.

On Sat, Nov 5, 2016 at 7:03 AM, Sherif Shehab <[hidden email]> wrote:

In my Grails 2.5.1 application , i was using a filter to use HTTPS with some controllers , everything was working fine but suddenly this filter is not working any more .

Filter :


def filters = {
    all(controller:'checkout', action:'onlinePayment') {
        before = {

            if (!request.isSecure() /*&& !Environment.isDevelopmentMode()*/) {
                def url = "https://" + request.serverName+':8443' + request.forwardURI
                println "in filter"
                redirect(url: url, permanent: true)
                return false
            }
        }
        after = { Map model ->
        }
        afterView = { Exception e ->
        }
    }
}


Here is the checkout page :


is there something i need to check to fix this issue ?


Thanks


--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/b9380dad-287e-4fb6-98be-ba3a83eb803c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Raviteja Lokineni | Business Intelligence Developer
TD Ameritrade


--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CAJpE9rUms2tgNaT7t7cMnWV%3Dnt66EPJjWBM-DR-k4MO_AT-F8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...