trait CorsSettings extends javadsl.settings.CorsSettings

Settings for the CORS support

This implementation is based on the akka-http-cors project by Lomig Mégard, licensed under the Apache License, Version 2.0.

Not for user extension

Self Type
CorsSettingsImpl
Annotations
@ApiMayChange() @DoNotInherit()
Source
CorsSettings.scala
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CorsSettings
  2. CorsSettings
  3. AnyRef
  4. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def allowCredentials: Boolean

    If enabled, the header Access-Control-Allow-Credentials is included in the response, indicating that the actual request can include user credentials.

    If enabled, the header Access-Control-Allow-Credentials is included in the response, indicating that the actual request can include user credentials. Examples of user credentials are: cookies, HTTP authentication or client-side certificates.

    Definition Classes
    CorsSettingsCorsSettings
  2. abstract def allowGenericHttpRequests: Boolean

    Allow generic requests, that are outside the scope of the specification, for example lacking an Origin header to pass through the directive.

    Allow generic requests, that are outside the scope of the specification, for example lacking an Origin header to pass through the directive.

    When false strict CORS filtering is applied and any invalid request will be rejected.

    Definition Classes
    CorsSettingsCorsSettings
  3. abstract def allowedHeaders: Set[String]

    Set of request headers that are allowed when making an actual request.

    Set of request headers that are allowed when making an actual request.

    Controls the content of the Access-Control-Allow-Headers header in a preflight response: If set to a single *, the headers from Access-Control-Request-Headers are echoed. Otherwise specified list of header names is returned as part of the header.

  4. abstract def allowedMethods: Set[HttpMethod]

    List of methods allowed when making an actual request.

    List of methods allowed when making an actual request. The listed headers are returned as part of the Access-Control-Allow-Methods preflight response header.

    The preflight request will be rejected if the Access-Control-Request-Method header's method is not part of the list.

  5. abstract def allowedOrigins: Set[String]

    List of origins that the CORS filter must allow.

    List of origins that the CORS filter must allow.

    Can also be set to a single * to allow access to the resource from any origin.

    Controls the content of the Access-Control-Allow-Origin response header: if parameter is * and credentials are not allowed, a * is returned in Access-Control-Allow-Origin. Otherwise, the origins given in the Origin request header are echoed.

    Hostname starting with *. will match any sub-domain. The scheme and the port are always strictly matched.

    The actual or preflight request is rejected if any of the origins from the request is not allowed.

  6. abstract def exposedHeaders: Set[String]

    Set of headers (other than simple response headers) that browsers are allowed to access.

    Set of headers (other than simple response headers) that browsers are allowed to access. If not empty, the listed headers are returned as part of the Access-Control-Expose-Headers header in responses.

  7. abstract def maxAge: FiniteDuration

    The time the browser is allowed to cache the results of a preflight request.

    The time the browser is allowed to cache the results of a preflight request. This value is returned as part of the Access-Control-Max-Age preflight response header. If scala.concurrent.duration.Duration.Zero, the header is not added to the preflight response.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from CorsSettings toany2stringadd[CorsSettings] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (CorsSettings, B)
    Implicit
    This member is added by an implicit conversion from CorsSettings toArrowAssoc[CorsSettings] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  8. def ensuring(cond: (CorsSettings) => Boolean, msg: => Any): CorsSettings
    Implicit
    This member is added by an implicit conversion from CorsSettings toEnsuring[CorsSettings] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (CorsSettings) => Boolean): CorsSettings
    Implicit
    This member is added by an implicit conversion from CorsSettings toEnsuring[CorsSettings] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: => Any): CorsSettings
    Implicit
    This member is added by an implicit conversion from CorsSettings toEnsuring[CorsSettings] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): CorsSettings
    Implicit
    This member is added by an implicit conversion from CorsSettings toEnsuring[CorsSettings] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def getAllowedHeaders: Set[String]

    Set of request headers that are allowed when making an actual request.

    Set of request headers that are allowed when making an actual request.

    Controls the content of the Access-Control-Allow-Headers header in a preflight response: If set to a single *, the headers from Access-Control-Request-Headers are echoed. Otherwise specified list of header names is returned as part of the header.

    Definition Classes
    CorsSettings
  15. def getAllowedMethods: Set[HttpMethod]

    List of methods allowed when making an actual request.

    List of methods allowed when making an actual request. The listed headers are returned as part of the Access-Control-Allow-Methods preflight response header.

    The preflight request will be rejected if the Access-Control-Request-Method header's method is not part of the list.

    Definition Classes
    CorsSettings
  16. def getAllowedOrigins: Set[String]

    List of origins that the CORS filter must allow.

    List of origins that the CORS filter must allow.

    Can also be set to a single * to allow access to the resource from any origin.

    Controls the content of the Access-Control-Allow-Origin response header: if parameter is * and credentials are not allowed, a * is returned in Access-Control-Allow-Origin. Otherwise, the origins given in the Origin request header are echoed.

    Hostname starting with *. will match any sub-domain. The scheme and the port are always strictly matched.

    The actual or preflight request is rejected if any of the origins from the request is not allowed.

    Definition Classes
    CorsSettings
  17. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  18. def getExposedHeaders: Set[String]

    Set of headers (other than simple response headers) that browsers are allowed to access.

    Set of headers (other than simple response headers) that browsers are allowed to access. If not empty, the listed headers are returned as part of the Access-Control-Expose-Headers header in responses.

    Definition Classes
    CorsSettings
  19. def getMaxAge: Duration

    The time the browser is allowed to cache the results of a preflight request.

    The time the browser is allowed to cache the results of a preflight request. This value is returned as part of the Access-Control-Max-Age preflight response header. If java.time.Duration.ZERO, the header is not added to the preflight response.

    Definition Classes
    CorsSettings
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  30. def withAllowAnyHeader(): CorsSettings
    Definition Classes
    CorsSettingsCorsSettings
  31. def withAllowAnyOrigin(): CorsSettings
    Definition Classes
    CorsSettingsCorsSettings
  32. def withAllowCredentials(allow: Boolean): CorsSettings
    Definition Classes
    CorsSettingsCorsSettings
  33. def withAllowGenericHttpRequests(allow: Boolean): CorsSettings
    Definition Classes
    CorsSettingsCorsSettings
  34. def withAllowedHeaders(headerNames: Set[String]): CorsSettings
  35. def withAllowedHeaders(headerNames: Set[String]): javadsl.settings.CorsSettings
    Definition Classes
    CorsSettings
  36. def withAllowedMethods(methods: Set[HttpMethod]): CorsSettings
  37. def withAllowedMethods(methods: Set[HttpMethod]): javadsl.settings.CorsSettings
    Definition Classes
    CorsSettings
  38. def withAllowedOrigins(origins: Set[String]): CorsSettings
  39. def withAllowedOrigins(origins: Set[String]): javadsl.settings.CorsSettings
    Definition Classes
    CorsSettings
  40. def withExposedHeaders(headerNames: Set[String]): CorsSettings
  41. def withExposedHeaders(headerNames: Set[String]): javadsl.settings.CorsSettings
    Definition Classes
    CorsSettings
  42. def withMaxAge(maxAge: FiniteDuration): CorsSettings

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from CorsSettings toStringFormat[CorsSettings] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

  3. def [B](y: B): (CorsSettings, B)
    Implicit
    This member is added by an implicit conversion from CorsSettings toArrowAssoc[CorsSettings] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.13.0) Use -> instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd fromCorsSettings to any2stringadd[CorsSettings]

Inherited by implicit conversion StringFormat fromCorsSettings to StringFormat[CorsSettings]

Inherited by implicit conversion Ensuring fromCorsSettings to Ensuring[CorsSettings]

Inherited by implicit conversion ArrowAssoc fromCorsSettings to ArrowAssoc[CorsSettings]

Ungrouped