com.twitter.finagle.http.filter.Cors

Policy

case class Policy(allowsOrigin: (String) ⇒ Option[String], allowsMethods: (String) ⇒ Option[Seq[String]], allowsHeaders: (Seq[String]) ⇒ Option[Seq[String]], exposedHeaders: Seq[String] = collection.this.Seq.empty[Nothing], supportsCredentials: Boolean = false, maxAge: Option[Duration] = scala.None) extends Product with Serializable

A Cross-Origin Resource Sharing policy.

A Policy determines how CORS response headers are set in response to a request with CORS headers:

allowsOrigin is a function that takes the value specified in the Origin request header and optionally returns the value of Access-Control-Allow-Origin.

allowsMethods is a function that takes the value of the Access-Control-Request-Method preflight request header and optionally returns a list of methods to be set in the Access-Control-Allow-Methods response header.

allowsHeaders is a function that takes the values set in the Access-Control-Request-Headers preflight request header and returns the header names to be set in the Access-Control-Allow- Headers response header.

exposedHeaders is the list of header names to be set in the Access-Control-Expose-Headers response header (in response to non-preflight requests).

If supportsCredentials is true and allowsOrigin does not return '*', the Access-Control- Allow-Credentials resopnse header will be set to 'true'.

If maxAge is defined, its value (in seconds) will be set in the Access-Control-Max-Age response header.

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Policy
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Policy(allowsOrigin: (String) ⇒ Option[String], allowsMethods: (String) ⇒ Option[Seq[String]], allowsHeaders: (Seq[String]) ⇒ Option[Seq[String]], exposedHeaders: Seq[String] = collection.this.Seq.empty[Nothing], supportsCredentials: Boolean = false, maxAge: Option[Duration] = scala.None)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. val allowsHeaders: (Seq[String]) ⇒ Option[Seq[String]]

  7. val allowsMethods: (String) ⇒ Option[Seq[String]]

  8. val allowsOrigin: (String) ⇒ Option[String]

  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. val exposedHeaders: Seq[String]

  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  16. val maxAge: Option[Duration]

  17. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  20. val supportsCredentials: Boolean

  21. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  22. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  23. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  24. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped