public class CORS extends Object
To be used in conjunction with the CORS
filter annotation.
Some typical usages in routes.conf:
OPTIONS /*catchall CORS.preflight( String catchall ) OPTIONS /single-resource CORS.preflight OPTIONS /variable/:path/resources CORS.preflight( String path ) OPTIONS /custom/cors CORS.preflight( String origin = 'http://example.com', \ String methods = 'GET', \ String headers = 'User-Agent', \ Boolean creds = true )
The only thing missing from the spec is support for custom Access-Control-Max-Age.
Constructor and Description |
---|
CORS() |
Modifier and Type | Method and Description |
---|---|
Outcome |
preflight() |
Outcome |
preflight(String path) |
Outcome |
preflight(String allowOrigin, String allowMethods, String allowHeaders, Boolean allowCredentials) |
Outcome |
preflight(String path, String allowOrigin, String allowMethods, String allowHeaders, Boolean allowCredentials) |