Class CorsSettingsImpl
java.lang.Object
org.apache.pekko.http.cors.javadsl.settings.CorsSettings
org.apache.pekko.http.cors.scaladsl.settings.CorsSettings
org.apache.pekko.http.cors.scaladsl.settings.CorsSettingsImpl
- All Implemented Interfaces:
Serializable,scala.Equals,scala.Product
INTERNAL API
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCorsSettingsImpl(boolean allowGenericHttpRequests, boolean allowCredentials, HttpOriginMatcher allowedOrigins, HttpHeaderRange allowedHeaders, scala.collection.immutable.Seq<HttpMethod> allowedMethods, scala.collection.immutable.Seq<String> exposedHeaders, scala.Option<Object> maxAge) -
Method Summary
Modifier and TypeMethodDescriptionscala.collection.immutable.List<HttpHeader>actualResponseHeaders(scala.collection.immutable.Seq<HttpOrigin> origins) booleanIndicates whether the resource supports user credentials.List of request headers that can be used when making an actual request.scala.collection.immutable.Seq<HttpMethod>List of methods that can be used when making an actual request.List of origins that the CORS filter must allow.booleanIftrue, allow generic requests (that are outside the scope of the specification) to pass through the directive.abstract static Rapply(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) scala.collection.immutable.Seq<String>List of headers (other than simple response headers) that browsers are allowed to access.scala.Option<Object>maxAge()When set, the amount of seconds the browser is allowed to cache the results of a preflight request.scala.collection.immutable.List<HttpHeader>preflightResponseHeaders(scala.collection.immutable.Seq<HttpOrigin> origins, scala.collection.immutable.Seq<String> requestHeaders) static StringtoString()Methods inherited from class org.apache.pekko.http.cors.scaladsl.settings.CorsSettings
apply, apply, apply, fromSubConfig, getAllowCredentials, getAllowedHeaders, getAllowedMethods, getAllowedOrigins, getAllowGenericHttpRequests, getExposedHeaders, getMaxAge, prefix, withAllowCredentials, withAllowedHeaders, withAllowedHeaders, withAllowedMethods, withAllowedMethods, withAllowedOrigins, withAllowedOrigins, withAllowGenericHttpRequests, withExposedHeaders, withExposedHeaders, withMaxAge, withMaxAgeMethods inherited from class org.apache.pekko.http.cors.javadsl.settings.CorsSettings
create, create, createMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface scala.Equals
canEqual, equalsMethods inherited from interface scala.Product
productArity, productElement, productElementName, productElementNames, productIterator
-
Constructor Details
-
CorsSettingsImpl
public CorsSettingsImpl(boolean allowGenericHttpRequests, boolean allowCredentials, HttpOriginMatcher allowedOrigins, HttpHeaderRange allowedHeaders, scala.collection.immutable.Seq<HttpMethod> allowedMethods, scala.collection.immutable.Seq<String> exposedHeaders, scala.Option<Object> maxAge)
-
-
Method Details
-
apply
public abstract static R apply(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) -
toString
-
allowGenericHttpRequests
public boolean allowGenericHttpRequests()Description copied from class:CorsSettingsIftrue, allow generic requests (that are outside the scope of the specification) to pass through the directive. Else, strict CORS filtering is applied and any invalid request will be rejected.Default:
true- Specified by:
allowGenericHttpRequestsin classCorsSettings- Returns:
- (undocumented)
-
allowCredentials
public boolean allowCredentials()Description copied from class:CorsSettingsIndicates whether the resource supports user credentials. Iftrue, the headerAccess-Control-Allow-Credentialsis set in the response, indicating that the actual request can include user credentials. Examples of user credentials are: cookies, HTTP authentication or client-side certificates.Default:
true- Specified by:
allowCredentialsin classCorsSettings- Returns:
- (undocumented)
-
allowedOrigins
Description copied from class:CorsSettingsList of origins that the CORS filter must allow. Can also be set to*to allow access to the resource from any origin. Controls the content of theAccess-Control-Allow-Originresponse header: if parameter is*and credentials are not allowed, a*is set inAccess-Control-Allow-Origin. Otherwise, the origins given in theOriginrequest 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.
Default:
HttpOriginMatcher.*- Specified by:
allowedOriginsin classCorsSettings- Returns:
- (undocumented)
-
allowedHeaders
Description copied from class:CorsSettingsList of request headers that can be used when making an actual request. Controls the content of theAccess-Control-Allow-Headersheader in a preflight response: if parameter is*, the headers fromAccess-Control-Request-Headersare echoed. Otherwise the parameter list is returned as part of the header.Default:
HttpHeaderRange.*- Specified by:
allowedHeadersin classCorsSettings- Returns:
- (undocumented)
-
allowedMethods
Description copied from class:CorsSettingsList of methods that can be used when making an actual request. The list is returned as part of theAccess-Control-Allow-Methodspreflight response header.The preflight request will be rejected if the
Access-Control-Request-Methodheader's method is not part of the list.Default:
Seq(GET, POST, HEAD, OPTIONS)- Specified by:
allowedMethodsin classCorsSettings- Returns:
- (undocumented)
-
exposedHeaders
Description copied from class:CorsSettingsList of headers (other than simple response headers) that browsers are allowed to access. If not empty, this list is returned as part of theAccess-Control-Expose-Headersheader in the actual response.Default:
Seq.empty- Specified by:
exposedHeadersin classCorsSettings- Returns:
- (undocumented)
-
maxAge
Description copied from class:CorsSettingsWhen set, the amount of seconds the browser is allowed to cache the results of a preflight request. This value is returned as part of theAccess-Control-Max-Agepreflight response header. IfNone, the header is not added to the preflight response.Default:
Some(30 * 60)- Specified by:
maxAgein classCorsSettings- Returns:
- (undocumented)
-
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
preflightResponseHeaders
public scala.collection.immutable.List<HttpHeader> preflightResponseHeaders(scala.collection.immutable.Seq<HttpOrigin> origins, scala.collection.immutable.Seq<String> requestHeaders) - Specified by:
preflightResponseHeadersin classCorsSettings
-
actualResponseHeaders
public scala.collection.immutable.List<HttpHeader> actualResponseHeaders(scala.collection.immutable.Seq<HttpOrigin> origins) - Specified by:
actualResponseHeadersin classCorsSettings
-