Cors

wvlet.airframe.http.filter.Cors
object Cors extends LogSupport

Attributes

Graph
Supertypes
trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
class Object
trait Matchable
class Any
Show all
Self type
Cors.type

Members list

Type members

Classlikes

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])

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Value members

Concrete methods

def newFilter(policy: Policy): RxHttpFilter

Create a new RxHttpFilter to add headers to support Cross-origin resource sharing (CORS).

Create a new RxHttpFilter to add headers to support Cross-origin resource sharing (CORS).

 Cors.newFilter(
   Cors.Policy(
     allowsOrigin = origin => { origin match {
       case x if x.endsWith("mydomain.com") => Some(origin)
       case _ => None
     }},
     allowsMethods = _ => Some(Seq(HttpMethod.POST)),
     allowsHeaders = headers => Some(headers)
  ))

Attributes

A CORS policy that lets you do whatever you want. Don't use this in production.

A CORS policy that lets you do whatever you want. Don't use this in production.

Attributes

Inherited methods

inline protected def debug(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def debug(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def error(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def error(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def info(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def info(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def logAt(inline logLevel: LogLevel, inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def trace(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def trace(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def warn(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def warn(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods