public class SimpleCorsDefaults extends Object implements CorsDefaults
CorsDefaults purely for testing purposes. This is not published by the REST module.| Modifier and Type | Field and Description |
|---|---|
static String |
CREDENTIALS |
static String |
NO_CREDENTIALS |
| Constructor and Description |
|---|
SimpleCorsDefaults() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowsCredentials(String uri)
Given an origin which has already passed an
CorsDefaults.allowsOrigin(String) check, tests that origin to determine
if it is whitelisted for making a credentialed CORS request, on behalf of a specific user. |
boolean |
allowsOrigin(String uri)
Tests the provided origin to determine if it is whitelisted for making non-credentialed CORS requests.
|
Set<String> |
getAllowedRequestHeaders(String uri)
For the provided origin, returns a set of HTTP headers which the browser may include when making a request.
|
Set<String> |
getAllowedResponseHeaders(String uri)
For the provided origin, returns a set of HTTP headers which the browser's CORS support can forward on to the
underlying request.
|
public static final String CREDENTIALS
public static final String NO_CREDENTIALS
public boolean allowsCredentials(String uri) throws IllegalArgumentException
CorsDefaultsCorsDefaults.allowsOrigin(String) check, tests that origin to determine
if it is whitelisted for making a credentialed CORS request, on behalf of a specific user.allowsCredentials in interface CorsDefaultsuri - The origin that has already been allowed. Will never be nullIllegalArgumentException - Thrown if the uri is not a valid origin or is null.public boolean allowsOrigin(String uri)
CorsDefaultsallowsOrigin in interface CorsDefaultsuri - The origin. Will never be nullpublic Set<String> getAllowedRequestHeaders(String uri)
CorsDefaultsgetAllowedRequestHeaders in interface CorsDefaultsuri - the origin that has already been allowed. Will never be nullCorsHeaders.ACCESS_CONTROL_ALLOW_HEADERSpublic Set<String> getAllowedResponseHeaders(String uri)
CorsDefaultsgetAllowedResponseHeaders in interface CorsDefaultsuri - the origin that has already been allowed. Will never be nullCorsHeaders.ACCESS_CONTROL_EXPOSE_HEADERSCopyright © 2016 Atlassian. All rights reserved.