Class CorsPathConfig.BuilderBase.CorsPathConfigImpl
- All Implemented Interfaces:
Prototype.Api,CorsPathConfig
- Enclosing class:
CorsPathConfig.BuilderBase<BUILDER extends CorsPathConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CorsPathConfig>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.helidon.webserver.cors.CorsPathConfig
CorsPathConfig.Builder, CorsPathConfig.BuilderBase<BUILDER extends CorsPathConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends CorsPathConfig> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCorsPathConfigImpl(CorsPathConfig.BuilderBase<?, ?> builder) Create an instance providing a builder. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether to allow credentials.Set of allowed headers, defaults to all.Set of allowed methods, defaults to all.Set of allowed origins, defaults to all.booleanenabled()Whether this CORS configuration should be enabled or not.booleanbooleanWhether this acts as an exclusive configuration for the configuredpathPattern.Set of exposed headers, defaults to none.inthashCode()maxAge()Max age as a duration.Path pattern to apply this configuration for.toString()
-
Constructor Details
-
CorsPathConfigImpl
Create an instance providing a builder.- Parameters:
builder- extending builder base of this prototype
-
-
Method Details
-
pathPattern
Description copied from interface:CorsPathConfigPath pattern to apply this configuration for. Note that paths are checked in sequence, and the first path that matches the request will be used to configure CORS.Always configure the most restrictive rules first.
- Specified by:
pathPatternin interfaceCorsPathConfig- Returns:
- path pattern as understood by WebServer routing
-
exclusive
public boolean exclusive()Description copied from interface:CorsPathConfigWhether this acts as an exclusive configuration for the configuredpathPattern. If exclusive, any CORS request matching the pattern will be exclusively handled with this configuration. If not exclusive, only CORS request matching the pattern AND a method will be handled by this configuration.- Specified by:
exclusivein interfaceCorsPathConfig- Returns:
- whether this is an exclusive configuration for the provided path, defaults to true
-
enabled
public boolean enabled()Description copied from interface:CorsPathConfigWhether this CORS configuration should be enabled or not. If disabled, this configuration will be ignored, and the next path will be checked.- Specified by:
enabledin interfaceCorsPathConfig- Returns:
- whether this configuration is enabled
-
allowOrigins
Description copied from interface:CorsPathConfigSet of allowed origins, defaults to all.If not empty, this will be used with "Access-Control-Allow-Origin" header. Note that allowed origins may be either a full origin, such as
http://www.example.com, or a regular expression. Any origin that contains (\), or*, or curly braces is considered a regular expression (i.e.http://.*\.example\.com).If you configure a regular expression, it would never be returned if all allowed origins are returned in a pre-flight request.
- Specified by:
allowOriginsin interfaceCorsPathConfig- Returns:
- allowed origins
-
allowHeaders
Description copied from interface:CorsPathConfigSet of allowed headers, defaults to all.If not empty, this will be used in "Access-Control-Allow-Headers" header.
- Specified by:
allowHeadersin interfaceCorsPathConfig- Returns:
- allowed headers
-
allowMethods
Description copied from interface:CorsPathConfigSet of allowed methods, defaults to all.- Specified by:
allowMethodsin interfaceCorsPathConfig- Returns:
- allowed methods
-
exposeHeaders
Description copied from interface:CorsPathConfigSet of exposed headers, defaults to none.If not empty, this will be used in "Access-Control-Expose-Headers" header.
- Specified by:
exposeHeadersin interfaceCorsPathConfig- Returns:
- exposed headers
-
allowCredentials
public boolean allowCredentials()Description copied from interface:CorsPathConfigWhether to allow credentials.If enabled, this will be used in "Access-Control-Allow-Credentials" header.
- Specified by:
allowCredentialsin interfaceCorsPathConfig- Returns:
- whether to allow credentials, defaults to
false
-
maxAge
Description copied from interface:CorsPathConfigMax age as a duration.This value will be used in "Access-Control-Max-Age" header (in seconds).
For backward compatibility, you can specify the following when used from configuration:
- integer (such as
3600) - number of seconds as a number - integer ms (such as
10000 ms) - number of milliseconds - duration format (such as
PT1H) - format ofDuration
- Specified by:
maxAgein interfaceCorsPathConfig- Returns:
- max age
- integer (such as
-
toString
-
equals
-
hashCode
public int hashCode()
-