Class Cors.Builder (2.22.5)

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
TypeDescription
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
NameDescription
maxAgeSecondsInteger
Returns
TypeDescription
Cors.Builder

setMethods(Iterable<HttpMethod> methods)

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

Sets the HTTP methods supported by this CORS configuration.

Parameter
NameDescription
methodsIterable<HttpMethod>
Returns
TypeDescription
Cors.Builder

setOrigins(Iterable<Cors.Origin> origins)

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

Sets the origins for this CORS configuration.

Parameter
NameDescription
originsIterable<Origin>
Returns
TypeDescription
Cors.Builder

setResponseHeaders(Iterable<String> headers)

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

Sets the response headers supported by this CORS configuration.

Parameter
NameDescription
headersIterable<String>
Returns
TypeDescription
Cors.Builder