Class

com.twitter.finagle.http.filter.Cors

HttpFilter

Related Doc: package Cors

Permalink

class HttpFilter extends Filter[Request, Response, Request, Response]

An HTTP filter that handles preflight (OPTIONS) requests and sets CORS response headers as described in the W3C CORS spec.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HttpFilter
  2. Filter
  3. Function2
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HttpFilter(policy: Policy)

    Permalink

Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. object Preflight

    Permalink
    Attributes
    protected[this]
  5. def addExposedHeaders(response: Response): Response

    Permalink

    If the list of exposed headers is not empty add one or more Access-Control-Expose- Headers headers, with as values the header field names given in the list of exposed headers.

    If the list of exposed headers is not empty add one or more Access-Control-Expose- Headers headers, with as values the header field names given in the list of exposed headers.

    By not adding the appropriate headers resource can also clear the preflight result cache of all entries where origin is a case-sensitive match for the value of the Origin header and url is a case-sensitive match for the URL of the resource.

    Attributes
    protected[this]
  6. def agnosticAndThen(next: TypeAgnostic): Filter[Request, Response, Request, Response]

    Permalink
    Definition Classes
    Filter
  7. def andThen(factory: ServiceFactory[Request, Response]): ServiceFactory[Request, Response]

    Permalink
    Definition Classes
    Filter
  8. def andThen(service: Service[Request, Response]): Service[Request, Response]

    Permalink
    Definition Classes
    Filter
  9. def andThen[Req2, Rep2](next: Filter[Request, Response, Req2, Rep2]): Filter[Request, Response, Req2, Rep2]

    Permalink
    Definition Classes
    Filter
  10. def andThenIf[Req2 >: Request, Rep2 <: Response](condAndFilter: (Boolean, Filter[Request, Response, Req2, Rep2])): Filter[Request, Response, Req2, Rep2]

    Permalink
    Definition Classes
    Filter
  11. def apply(request: Request, service: Service[Request, Response]): Future[Response]

    Permalink

    Fully handle preflight requests.

    Fully handle preflight requests. If a preflight request is deemed to be unacceptable, a 200 OK response is served without CORS headers.

    Adds CORS response headers onto all non-preflight requests that have the 'Origin' header set to a value that is allowed by the Policy.

    Definition Classes
    HttpFilter → Filter → Function2
  12. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  13. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. def curried: (Request) ⇒ (Service[Request, Response]) ⇒ Future[Response]

    Permalink
    Definition Classes
    Function2
    Annotations
    @unspecialized()
  15. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  19. def getHeaders(request: Request): Seq[String]

    Permalink

    Let header field-names be the values as result of parsing the Access-Control-Request-Headers headers.

    Let header field-names be the values as result of parsing the Access-Control-Request-Headers headers. If there are no Access-Control-Request-Headers headers let header field-names be the empty list.

    Attributes
    protected[this]
  20. def getMethod(request: Request): Option[String]

    Permalink

    Let method be the value as result of parsing the Access-Control-Request-Method header.

    Let method be the value as result of parsing the Access-Control-Request-Method header.

    Attributes
    protected[this]
  21. def getOrigin(request: Request): Option[String]

    Permalink
    Attributes
    protected[this]
  22. def handlePreflight(request: Request): Option[Response]

    Permalink

    http://www.w3.org/TR/cors/#resource-preflight-requests

    http://www.w3.org/TR/cors/#resource-preflight-requests

    Attributes
    protected[this]
  23. def handleSimple(request: Request, response: Response): Response

    Permalink

    http://www.w3.org/TR/cors/#resource-requests

    http://www.w3.org/TR/cors/#resource-requests

    Attributes
    protected[this]
  24. def hashCode(): Int

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

    Permalink
    Definition Classes
    Any
  26. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  29. def setHeaders(response: Response, headers: Seq[String]): Response

    Permalink

    If each of the header field-names is a simple header and none is Content-Type, than this step may be skipped.

    If each of the header field-names is a simple header and none is Content-Type, than this step may be skipped.

    Add one or more Access-Control-Allow-Headers headers consisting of (a subset of) the list of headers.

    Attributes
    protected[this]
  30. def setMaxAge(response: Response): Response

    Permalink

    Optionally add a single Access-Control-Max-Age header with as value the amount of seconds the user agent is allowed to cache the result of the request.

    Optionally add a single Access-Control-Max-Age header with as value the amount of seconds the user agent is allowed to cache the result of the request.

    Attributes
    protected[this]
  31. def setMethod(response: Response, methods: Seq[String]): Response

    Permalink

    If method is a simple method this step may be skipped.

    If method is a simple method this step may be skipped.

    Add one or more Access-Control-Allow-Methods headers consisting of (a subset of) the list of methods.

    Attributes
    protected[this]
  32. def setOriginAndCredentials(response: Response, origin: String): Response

    Permalink

    If the resource supports credentials add a single Access-Control-Allow-Origin header, with the value of the Origin header as value, and add a single Access-Control-Allow-Credentials header with the case-sensitive string "true" as value.

    If the resource supports credentials add a single Access-Control-Allow-Origin header, with the value of the Origin header as value, and add a single Access-Control-Allow-Credentials header with the case-sensitive string "true" as value.

    Otherwise, add a single Access-Control-Allow-Origin header, with either the value of the Origin header or the string "*" as value.

    n.b. The string "*" cannot be used for a resource that supports credentials.

    Attributes
    protected[this]
  33. def setVary(response: Response): Response

    Permalink

    Resources that wish to enable themselves to be shared with multiple Origins but do not respond uniformly with "*" must in practice generate the Access-Control-Allow-Origin header dynamically in response to every request they wish to allow.

    Resources that wish to enable themselves to be shared with multiple Origins but do not respond uniformly with "*" must in practice generate the Access-Control-Allow-Origin header dynamically in response to every request they wish to allow. As a consequence, authors of such resources should send a Vary: Origin HTTP header or provide other appropriate control directives to prevent caching of such responses, which may be inaccurate if re-used across- origins.

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

    Permalink
    Definition Classes
    AnyRef
  35. def toString(): String

    Permalink
    Definition Classes
    Filter → Function2 → AnyRef → Any
  36. def tupled: ((Request, Service[Request, Response])) ⇒ Future[Response]

    Permalink
    Definition Classes
    Function2
    Annotations
    @unspecialized()
  37. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Filter[Request, Response, Request, Response]

Inherited from (Request, Service[Request, Response]) ⇒ Future[Response]

Inherited from AnyRef

Inherited from Any

Ungrouped