case class CORSConfig(allowedOrigins: Origins = Origins.None, isHttpMethodAllowed: (String) ⇒ Boolean = _ => true, isHttpHeaderAllowed: (String) ⇒ Boolean = _ => true, exposedHeaders: Seq[String] = Seq.empty, supportsCredentials: Boolean = true, preflightMaxAge: Duration = 1.hour, serveForbiddenOrigins: Boolean = false) extends Product with Serializable
Configuration for play.filters.cors.AbstractCORSPolicy.
- allow only requests with origins from a whitelist (by default all origins are allowed)
- allow only HTTP methods from a whitelist for preflight requests (by default all methods are allowed)
- allow only HTTP headers from a whitelist for preflight requests (by default all headers are allowed)
- set custom HTTP headers to be exposed in the response (by default no headers are exposed)
- disable/enable support for credentials (by default credentials support is enabled)
- set how long (in seconds) the results of a preflight request can be cached in a preflight result cache (by default 3600 seconds, 1 hour)
- enable/disable serving requests with origins not in whitelist as non-CORS requests (by default they are forbidden)
- allowedOrigins
§6.1.2 §6.2.2 Always matching is acceptable since the list of origins can be unbounded.
- isHttpMethodAllowed
§6.2.5 Always matching is acceptable since the list of methods can be unbounded.
- isHttpHeaderAllowed
§6.2.6 Always matching is acceptable since the list of headers can be unbounded.
- Source
- CORSConfig.scala
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- CORSConfig
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Instance Constructors
-
new
CORSConfig(allowedOrigins: Origins = Origins.None, isHttpMethodAllowed: (String) ⇒ Boolean = _ => true, isHttpHeaderAllowed: (String) ⇒ Boolean = _ => true, exposedHeaders: Seq[String] = Seq.empty, supportsCredentials: Boolean = true, preflightMaxAge: Duration = 1.hour, serveForbiddenOrigins: Boolean = false)
- allowedOrigins
§6.1.2 §6.2.2 Always matching is acceptable since the list of origins can be unbounded.
- isHttpMethodAllowed
§6.2.5 Always matching is acceptable since the list of methods can be unbounded.
- isHttpHeaderAllowed
§6.2.6 Always matching is acceptable since the list of headers can be unbounded.
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val allowedOrigins: Origins
- def anyOriginAllowed: Boolean
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val exposedHeaders: Seq[String]
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val isHttpHeaderAllowed: (String) ⇒ Boolean
- val isHttpMethodAllowed: (String) ⇒ Boolean
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val preflightMaxAge: Duration
- val serveForbiddenOrigins: Boolean
- val supportsCredentials: Boolean
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def withAnyOriginAllowed: CORSConfig
- def withCredentialsSupport(supportsCredentials: Boolean): CORSConfig
- def withExposedHeaders(headers: List[String]): CORSConfig
- def withExposedHeaders(headers: Seq[String]): CORSConfig
- def withHeadersAllowed(headers: Function[String, Boolean]): CORSConfig
- def withHeadersAllowed(headers: (String) ⇒ Boolean): CORSConfig
- def withMethodsAllowed(methods: Function[String, Boolean]): CORSConfig
- def withMethodsAllowed(methods: (String) ⇒ Boolean): CORSConfig
- def withOriginsAllowed(origins: Function[String, Boolean]): CORSConfig
- def withOriginsAllowed(origins: (String) ⇒ Boolean): CORSConfig
- def withPreflightMaxAge(maxAge: Duration): CORSConfig
- def withPreflightMaxAge(maxAge: Duration): CORSConfig
- def withServeForbiddenOrigins(serveForbiddenOrigins: Boolean): CORSConfig