Class Cors.Builder (2.28.0)

public static final class Cors.Builder

CORS configuration builder.

Inheritance

java.lang.Object > Cors.Builder

Methods

build()

public Cors build()

Creates a CORS configuration.

Returns
Type Description
Cors

setMaxAgeSeconds(Integer maxAgeSeconds)

public Cors.Builder setMaxAgeSeconds(Integer maxAgeSeconds)

Sets the max time in seconds in which a client can issue requests before sending a new preflight request.

Parameter
Name Description
maxAgeSeconds Integer
Returns
Type Description
Cors.Builder

setMethods(Iterable<HttpMethod> methods)

public Cors.Builder setMethods(Iterable<HttpMethod> methods)

Sets the HTTP methods supported by this CORS configuration.

Parameter
Name Description
methods Iterable<HttpMethod>
Returns
Type Description
Cors.Builder

setOrigins(Iterable<Cors.Origin> origins)

public Cors.Builder setOrigins(Iterable<Cors.Origin> origins)

Sets the origins for this CORS configuration.

Parameter
Name Description
origins Iterable<Origin>
Returns
Type Description
Cors.Builder

setResponseHeaders(Iterable<String> headers)

public Cors.Builder setResponseHeaders(Iterable<String> headers)

Sets the response headers supported by this CORS configuration.

Parameter
Name Description
headers Iterable<String>
Returns
Type Description
Cors.Builder