public static class CorsPolicy.Builder extends Object
Modifier and Type | Method and Description |
---|---|
CorsPolicy.Builder |
addAllAllowHeaders(List<String> allowHeaders)
Specifies the content for the Access-Control-Allow-Headers header.
|
CorsPolicy.Builder |
addAllAllowMethods(List<String> allowMethods)
Specifies the content for the Access-Control-Allow-Methods header.
|
CorsPolicy.Builder |
addAllAllowOriginRegexes(List<String> allowOriginRegexes)
Specifies the regualar expression patterns that match allowed origins.
|
CorsPolicy.Builder |
addAllAllowOrigins(List<String> allowOrigins)
Specifies the list of origins that will be allowed to do CORS requests.
|
CorsPolicy.Builder |
addAllExposeHeaders(List<String> exposeHeaders)
Specifies the content for the Access-Control-Expose-Headers header.
|
CorsPolicy.Builder |
addAllowHeaders(String allowHeaders)
Specifies the content for the Access-Control-Allow-Headers header.
|
CorsPolicy.Builder |
addAllowMethods(String allowMethods)
Specifies the content for the Access-Control-Allow-Methods header.
|
CorsPolicy.Builder |
addAllowOriginRegexes(String allowOriginRegexes)
Specifies the regualar expression patterns that match allowed origins.
|
CorsPolicy.Builder |
addAllowOrigins(String allowOrigins)
Specifies the list of origins that will be allowed to do CORS requests.
|
CorsPolicy.Builder |
addExposeHeaders(String exposeHeaders)
Specifies the content for the Access-Control-Expose-Headers header.
|
CorsPolicy |
build() |
CorsPolicy.Builder |
clone() |
Boolean |
getAllowCredentials()
In response to a preflight request, setting this to true indicates that the actual request
can include user credentials.
|
List<String> |
getAllowHeadersList()
Specifies the content for the Access-Control-Allow-Headers header.
|
List<String> |
getAllowMethodsList()
Specifies the content for the Access-Control-Allow-Methods header.
|
List<String> |
getAllowOriginRegexesList()
Specifies the regualar expression patterns that match allowed origins.
|
List<String> |
getAllowOriginsList()
Specifies the list of origins that will be allowed to do CORS requests.
|
Boolean |
getDisabled()
If true, specifies the CORS policy is disabled.
|
List<String> |
getExposeHeadersList()
Specifies the content for the Access-Control-Expose-Headers header.
|
Integer |
getMaxAge()
Specifies how long the results of a preflight request can be cached.
|
CorsPolicy.Builder |
mergeFrom(CorsPolicy other) |
CorsPolicy.Builder |
setAllowCredentials(Boolean allowCredentials)
In response to a preflight request, setting this to true indicates that the actual request
can include user credentials.
|
CorsPolicy.Builder |
setDisabled(Boolean disabled)
If true, specifies the CORS policy is disabled.
|
CorsPolicy.Builder |
setMaxAge(Integer maxAge)
Specifies how long the results of a preflight request can be cached.
|
public CorsPolicy.Builder mergeFrom(CorsPolicy other)
public Boolean getAllowCredentials()
public CorsPolicy.Builder setAllowCredentials(Boolean allowCredentials)
public List<String> getAllowHeadersList()
public CorsPolicy.Builder addAllAllowHeaders(List<String> allowHeaders)
public CorsPolicy.Builder addAllowHeaders(String allowHeaders)
public List<String> getAllowMethodsList()
public CorsPolicy.Builder addAllAllowMethods(List<String> allowMethods)
public CorsPolicy.Builder addAllowMethods(String allowMethods)
public List<String> getAllowOriginRegexesList()
public CorsPolicy.Builder addAllAllowOriginRegexes(List<String> allowOriginRegexes)
public CorsPolicy.Builder addAllowOriginRegexes(String allowOriginRegexes)
public List<String> getAllowOriginsList()
public CorsPolicy.Builder addAllAllowOrigins(List<String> allowOrigins)
public CorsPolicy.Builder addAllowOrigins(String allowOrigins)
public Boolean getDisabled()
public CorsPolicy.Builder setDisabled(Boolean disabled)
public List<String> getExposeHeadersList()
public CorsPolicy.Builder addAllExposeHeaders(List<String> exposeHeaders)
public CorsPolicy.Builder addExposeHeaders(String exposeHeaders)
public Integer getMaxAge()
public CorsPolicy.Builder setMaxAge(Integer maxAge)
public CorsPolicy build()
public CorsPolicy.Builder clone()
Copyright © 2019 Google LLC. All rights reserved.