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], supportsCredentials: Boolean, maxAge: Option[Duration]) 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. Hide All
  2. Show all
  1. Policy
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
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 canEqual(arg0: Any): Boolean

    Definition Classes
    Policy → Equals
  11. def clone(): AnyRef

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

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    Policy → Equals → AnyRef → Any
  14. val exposedHeaders: Seq[String]

  15. def finalize(): Unit

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

    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

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

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

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

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

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

    Definition Classes
    AnyRef
  23. def productArity: Int

    Definition Classes
    Policy → Product
  24. def productElement(arg0: Int): Any

    Definition Classes
    Policy → Product
  25. def productIterator: Iterator[Any]

    Definition Classes
    Product
  26. def productPrefix: String

    Definition Classes
    Policy → Product
  27. val supportsCredentials: Boolean

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

    Definition Classes
    AnyRef
  29. def toString(): String

    Definition Classes
    Policy → AnyRef → Any
  30. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. def productElements: Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    (Since version 2.8.0) use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any