Compute Engine v1 API - Class CorsPolicy (2.5.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
Boolean

AllowHeaders

public RepeatedField<string> AllowHeaders { get; }

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

Property Value
TypeDescription
RepeatedField<String>

AllowMethods

public RepeatedField<string> AllowMethods { get; }

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

Property Value
TypeDescription
RepeatedField<String>

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
RepeatedField<String>

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
RepeatedField<String>

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
Boolean

ExposeHeaders

public RepeatedField<string> ExposeHeaders { get; }

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

Property Value
TypeDescription
RepeatedField<String>

HasAllowCredentials

public bool HasAllowCredentials { get; }

Gets whether the "allow_credentials" field is set

Property Value
TypeDescription
Boolean

HasDisabled

public bool HasDisabled { get; }

Gets whether the "disabled" field is set

Property Value
TypeDescription
Boolean

HasMaxAge

public bool HasMaxAge { get; }

Gets whether the "max_age" field is set

Property Value
TypeDescription
Boolean

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
Int32