Show / Hide Table of Contents

Class CorsPolicy

The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing

Inheritance
System.Object
CorsPolicy
Implements
IDirectResponseSchema
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Google.Apis.Compute.v1.Data
Assembly: Google.Apis.Compute.v1.dll
Syntax
public class CorsPolicy : IDirectResponseSchema

Properties

AllowCredentials

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 is false.

Declaration
[JsonProperty("allowCredentials")]
public virtual bool? AllowCredentials { get; set; }
Property Value
Type Description
System.Nullable<System.Boolean>

AllowHeaders

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

Declaration
[JsonProperty("allowHeaders")]
public virtual IList<string> AllowHeaders { get; set; }
Property Value
Type Description
System.Collections.Generic.IList<System.String>

AllowMethods

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

Declaration
[JsonProperty("allowMethods")]
public virtual IList<string> AllowMethods { get; set; }
Property Value
Type Description
System.Collections.Generic.IList<System.String>

AllowOriginRegexes

Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see github.com/google/re2/wiki/Syntax An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.

Declaration
[JsonProperty("allowOriginRegexes")]
public virtual IList<string> AllowOriginRegexes { get; set; }
Property Value
Type Description
System.Collections.Generic.IList<System.String>

AllowOrigins

Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.

Declaration
[JsonProperty("allowOrigins")]
public virtual IList<string> AllowOrigins { get; set; }
Property Value
Type Description
System.Collections.Generic.IList<System.String>

Disabled

If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.

Declaration
[JsonProperty("disabled")]
public virtual bool? Disabled { get; set; }
Property Value
Type Description
System.Nullable<System.Boolean>

ETag

The ETag of the item.

Declaration
public virtual string ETag { get; set; }
Property Value
Type Description
System.String

ExposeHeaders

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

Declaration
[JsonProperty("exposeHeaders")]
public virtual IList<string> ExposeHeaders { get; set; }
Property Value
Type Description
System.Collections.Generic.IList<System.String>

MaxAge

Specifies how long results of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.

Declaration
[JsonProperty("maxAge")]
public virtual int? MaxAge { get; set; }
Property Value
Type Description
System.Nullable<System.Int32>

Implements

IDirectResponseSchema
In This Article
Back to top