Compute Engine v1 API - Class CorsPolicy (2.13.0)

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.

Inheritance

object > CorsPolicy

Namespace

Google.Cloud.Compute.V1

Assembly

Google.Cloud.Compute.V1.dll

Constructors

CorsPolicy()

public CorsPolicy()

CorsPolicy(CorsPolicy)

public CorsPolicy(CorsPolicy other)
Parameter
NameDescription
otherCorsPolicy

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
TypeDescription
bool

AllowHeaders

public RepeatedField<string> AllowHeaders { get; }

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

Property Value
TypeDescription
RepeatedFieldstring

AllowMethods

public RepeatedField<string> AllowMethods { get; }

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

Property Value
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
bool

ExposeHeaders

public RepeatedField<string> ExposeHeaders { get; }

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

Property Value
TypeDescription
RepeatedFieldstring

HasAllowCredentials

public bool HasAllowCredentials { get; }

Gets whether the "allow_credentials" field is set

Property Value
TypeDescription
bool

HasDisabled

public bool HasDisabled { get; }

Gets whether the "disabled" field is set

Property Value
TypeDescription
bool

HasMaxAge

public bool HasMaxAge { get; }

Gets whether the "max_age" field is set

Property Value
TypeDescription
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
TypeDescription
int