New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RoutesFilter - Ability to define or modify variables in validate method #107

Open
codeconsole opened this Issue Jan 26, 2012 · 0 comments

Comments

Projects
None yet
1 participant
@codeconsole
Contributor

codeconsole commented Jan 26, 2012

For example, if you wanted to redirect all appspot requests to an owned domain:

all "@path", validate: {
    var mydomain = "www.twitter.com"
    request.requestURL.toString().matches("http://[\\w\\-]+\\.appspot\\.com.*")
}, redirect:  "https://@mydomain@path"

Obviously the setting of the var would be more dynamic in real life. For example, I have a filter that sets my dynamic properties in the request scope. So I could say:

var mydomain = request.mydomain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment