public class CorsFilter extends Filter
Filter
that adds Cross-Origin
Resource Sharing (CORS) response headers.
This class should be unnecessary once Restlet properly supports Access-Control-Max-Age.
"Restlet" is a registered trademark of Restlet S.A.S..
Modifier and Type | Field and Description |
---|---|
static int |
FAR_FUTURE
A far future max age (10 years)
|
static String |
MAX_AGE_HEADER
The maximum age header.
|
Constructor and Description |
---|
CorsFilter()
Constructor.
|
CorsFilter(Context context)
Constructor.
|
CorsFilter(Context context,
Restlet next)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterHandle(Request request,
Response response) |
Set<String> |
getAllowHeaders()
The allowed headers.
|
Set<Method> |
getAllowMethods()
The allowed methods.
|
String |
getAllowOrigin()
The allowed origin.
|
int |
getMaxAge()
The maximum age.
|
void |
setAllowOrigin(String allowOrigin) |
void |
setMaxAge(int maxAge) |
String |
toString() |
beforeHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
public static int FAR_FUTURE
public static final String MAX_AGE_HEADER
public CorsFilter()
public CorsFilter(Context context)
context
- The contextpublic String getAllowOrigin()
setAllowOrigin(String)
public void setAllowOrigin(String allowOrigin)
allowOrigin
- The allowed origingetAllowOrigin()
public Set<Method> getAllowMethods()
public Set<String> getAllowHeaders()
public int getMaxAge()
setMaxAge(int)
public void setMaxAge(int maxAge)
maxAge
- The maximum agegetMaxAge()
protected void afterHandle(Request request, Response response)
afterHandle
in class Filter
Copyright © 2009-2016 Three Crickets LLC.