Reference documentation and code samples for the Google Cloud Network Services V1 Client class CorsPolicy.
The Specification for allowing client side cross-origin requests.
Generated from protobuf message google.cloud.networkservices.v1.HttpRoute.CorsPolicy
Namespace
Google \ Cloud \ NetworkServices \ V1 \ HttpRouteMethods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ allow_origins
array
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.
↳ allow_origin_regexes
array
Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax .
↳ allow_methods
array
Specifies the content for Access-Control-Allow-Methods header.
↳ allow_headers
array
Specifies the content for Access-Control-Allow-Headers header.
↳ expose_headers
array
Specifies the content for Access-Control-Expose-Headers header.
↳ max_age
string
Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.
↳ allow_credentials
bool
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.
↳ disabled
bool
If true, the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.
getAllowOrigins
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.
setAllowOrigins
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.
var
string[]
$this
getAllowOriginRegexes
Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax .
setAllowOriginRegexes
Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax .
var
string[]
$this
getAllowMethods
Specifies the content for Access-Control-Allow-Methods header.
setAllowMethods
Specifies the content for Access-Control-Allow-Methods header.
var
string[]
$this
getAllowHeaders
Specifies the content for Access-Control-Allow-Headers header.
setAllowHeaders
Specifies the content for Access-Control-Allow-Headers header.
var
string[]
$this
getExposeHeaders
Specifies the content for Access-Control-Expose-Headers header.
setExposeHeaders
Specifies the content for Access-Control-Expose-Headers header.
var
string[]
$this
getMaxAge
Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.
string
setMaxAge
Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.
var
string
$this
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
setAllowCredentials
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.
var
bool
$this
getDisabled
If true, the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.
bool
setDisabled
If true, the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.
var
bool
$this