Interface HttpRoute.CorsPolicyOrBuilder (0.11.0)

public static interface HttpRoute.CorsPolicyOrBuilder extends MessageOrBuilder

Implements

MessageOrBuilder

Methods

getAllowCredentials()

public abstract boolean getAllowCredentials()

In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header.

Default value is false.

bool allow_credentials = 7;

Returns
Type Description
boolean

The allowCredentials.

getAllowHeaders(int index)

public abstract String getAllowHeaders(int index)

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The allowHeaders at the given index.

getAllowHeadersBytes(int index)

public abstract ByteString getAllowHeadersBytes(int index)

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the allowHeaders at the given index.

getAllowHeadersCount()

public abstract int getAllowHeadersCount()

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Returns
Type Description
int

The count of allowHeaders.

getAllowHeadersList()

public abstract List<String> getAllowHeadersList()

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Returns
Type Description
List<String>

A list containing the allowHeaders.

getAllowMethods(int index)

public abstract String getAllowMethods(int index)

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The allowMethods at the given index.

getAllowMethodsBytes(int index)

public abstract ByteString getAllowMethodsBytes(int index)

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the allowMethods at the given index.

getAllowMethodsCount()

public abstract int getAllowMethodsCount()

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Returns
Type Description
int

The count of allowMethods.

getAllowMethodsList()

public abstract List<String> getAllowMethodsList()

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Returns
Type Description
List<String>

A list containing the allowMethods.

getAllowOriginRegexes(int index)

public abstract String getAllowOriginRegexes(int index)

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The allowOriginRegexes at the given index.

getAllowOriginRegexesBytes(int index)

public abstract ByteString getAllowOriginRegexesBytes(int index)

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the allowOriginRegexes at the given index.

getAllowOriginRegexesCount()

public abstract int getAllowOriginRegexesCount()

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Returns
Type Description
int

The count of allowOriginRegexes.

getAllowOriginRegexesList()

public abstract List<String> getAllowOriginRegexesList()

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Returns
Type Description
List<String>

A list containing the allowOriginRegexes.

getAllowOrigins(int index)

public abstract String getAllowOrigins(int index)

Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The allowOrigins at the given index.

getAllowOriginsBytes(int index)

public abstract ByteString getAllowOriginsBytes(int index)

Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the allowOrigins at the given index.

getAllowOriginsCount()

public abstract int getAllowOriginsCount()

Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Returns
Type Description
int

The count of allowOrigins.

getAllowOriginsList()

public abstract List<String> getAllowOriginsList()

Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Returns
Type Description
List<String>

A list containing the allowOrigins.

getDisabled()

public abstract boolean getDisabled()

If true, the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.

bool disabled = 8;

Returns
Type Description
boolean

The disabled.

getExposeHeaders(int index)

public abstract String getExposeHeaders(int index)

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The exposeHeaders at the given index.

getExposeHeadersBytes(int index)

public abstract ByteString getExposeHeadersBytes(int index)

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the exposeHeaders at the given index.

getExposeHeadersCount()

public abstract int getExposeHeadersCount()

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Returns
Type Description
int

The count of exposeHeaders.

getExposeHeadersList()

public abstract List<String> getExposeHeadersList()

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Returns
Type Description
List<String>

A list containing the exposeHeaders.

getMaxAge()

public abstract String getMaxAge()

Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.

string max_age = 6;

Returns
Type Description
String

The maxAge.

getMaxAgeBytes()

public abstract ByteString getMaxAgeBytes()

Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.

string max_age = 6;

Returns
Type Description
ByteString

The bytes for maxAge.