Grails 2.5.6奇怪的过滤器行为

时间:2019-06-24 04:23:03

标签: grails grails-2.5

我有Grails 2.5.6个应用程序正在使用Spring Security Grails plugin,并且该应用程序中有一个过滤器,用于检查是否存在某些内容,如果不需要,则继续正常运行,如果不必必须转到控制器Country,则执行操作{{1} },访问过滤器之前的URL为 countryAndCity 。执行过滤器后,重定向URL为 https://localhost:8443/MyApp/login/auth

是什么使URL中出现这种奇怪的行为?以下是此阶段执行的2个过滤器:

SwitchToHTTPSFilters:

http://localhost:8080//countries/countryAndCity

SetCountryAndCityFirstFilters:

def filters = {

    // to redirect to HTTPS for the below actions
    all(controller: 'users|login|countries', action: 'create|auth|*', actionExclude: 'logout') {
        before = {


            if (!request.isSecure()) {
           def url = "https://" + request.serverName + ':8443' + request.forwardURI

                redirect(url: url, permanent: true)
                return false
            }
        }
        after = {Map model ->
        }
        afterView = {Exception e ->
        }
    }
}

0 个答案:

没有答案