public sealed class CorsPolicy : IMessage<CorsPolicy>, IEquatable<CorsPolicy>, IDeepCloneable<CorsPolicy>, IBufferMessage, IMessage
Reference documentation and code samples for the Compute Engine v1 API class CorsPolicy.
The specification for allowing client-side cross-origin requests. For more information about the W3C recommendation for cross-origin resource sharing (CORS), see Fetch API Living Standard.
Implements
IMessageCorsPolicy, IEquatableCorsPolicy, IDeepCloneableCorsPolicy, IBufferMessage, IMessageNamespace
Google.Cloud.Compute.V1Assembly
Google.Cloud.Compute.V1.dll
Constructors
CorsPolicy()
public CorsPolicy()
CorsPolicy(CorsPolicy)
public CorsPolicy(CorsPolicy other)
Parameter | |
---|---|
Name | Description |
other | CorsPolicy |
Properties
AllowCredentials
public bool AllowCredentials { get; set; }
In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This field translates to the Access-Control-Allow-Credentials header. Default is false.
Property Value | |
---|---|
Type | Description |
bool |
AllowHeaders
public RepeatedField<string> AllowHeaders { get; }
Specifies the content for the Access-Control-Allow-Headers header.
Property Value | |
---|---|
Type | Description |
RepeatedFieldstring |
AllowMethods
public RepeatedField<string> AllowMethods { get; }
Specifies the content for the Access-Control-Allow-Methods header.
Property Value | |
---|---|
Type | Description |
RepeatedFieldstring |
AllowOriginRegexes
public RepeatedField<string> AllowOriginRegexes { get; }
Specifies a regular expression that matches allowed origins. For more information about the regular expression syntax, see Syntax. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes. Regular expressions can only be used when the loadBalancingScheme is set to INTERNAL_SELF_MANAGED.
Property Value | |
---|---|
Type | Description |
RepeatedFieldstring |
AllowOrigins
public RepeatedField<string> AllowOrigins { get; }
Specifies the list of origins that is allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
Property Value | |
---|---|
Type | Description |
RepeatedFieldstring |
Disabled
public bool Disabled { get; set; }
If true, the setting specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.
Property Value | |
---|---|
Type | Description |
bool |
ExposeHeaders
public RepeatedField<string> ExposeHeaders { get; }
Specifies the content for the Access-Control-Expose-Headers header.
Property Value | |
---|---|
Type | Description |
RepeatedFieldstring |
HasAllowCredentials
public bool HasAllowCredentials { get; }
Gets whether the "allow_credentials" field is set
Property Value | |
---|---|
Type | Description |
bool |
HasDisabled
public bool HasDisabled { get; }
Gets whether the "disabled" field is set
Property Value | |
---|---|
Type | Description |
bool |
HasMaxAge
public bool HasMaxAge { get; }
Gets whether the "max_age" field is set
Property Value | |
---|---|
Type | Description |
bool |
MaxAge
public int MaxAge { get; set; }
Specifies how long results of a preflight request can be cached in seconds. This field translates to the Access-Control-Max-Age header.
Property Value | |
---|---|
Type | Description |
int |