# Network Services V1 API - Class Google::Cloud::NetworkServices::V1::HttpRoute::CorsPolicy (v2.10.1)

2.10.1 (latest) 2.10.0 2.9.0 2.8.0 2.7.0 2.6.1 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.1 1.2.0 1.1.0 1.0.1 0.2.0 0.1.0 Reference documentation and code samples for the Network Services V1 API class Google::Cloud::NetworkServices::V1::HttpRoute::CorsPolicy.

The Specification for allowing client side cross-origin requests.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #allow_credentials

    def allow_credentials() -> ::Boolean

**Returns**

- (::Boolean) --- 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.

### #allow_credentials=

    def allow_credentials=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- 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.
**Returns**

- (::Boolean) --- 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.

### #allow_headers

    def allow_headers() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Specifies the content for Access-Control-Allow-Headers header.

### #allow_headers=

    def allow_headers=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Specifies the content for Access-Control-Allow-Headers header.
**Returns**

- (::Array\<::String\>) --- Specifies the content for Access-Control-Allow-Headers header.

### #allow_methods

    def allow_methods() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Specifies the content for Access-Control-Allow-Methods header.

### #allow_methods=

    def allow_methods=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Specifies the content for Access-Control-Allow-Methods header.
**Returns**

- (::Array\<::String\>) --- Specifies the content for Access-Control-Allow-Methods header.

### #allow_origin_regexes

    def allow_origin_regexes() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

### #allow_origin_regexes=

    def allow_origin_regexes=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.
**Returns**

- (::Array\<::String\>) --- Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

### #allow_origins

    def allow_origins() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- 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_origins=

    def allow_origins=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- 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.
**Returns**

- (::Array\<::String\>) --- 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.

### #disabled

    def disabled() -> ::Boolean

**Returns**

- (::Boolean) --- If true, the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.

### #disabled=

    def disabled=(value) -> ::Boolean

**Parameter**

- **value** (::Boolean) --- If true, the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.
**Returns**

- (::Boolean) --- If true, the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.

### #expose_headers

    def expose_headers() -> ::Array<::String>

**Returns**

- (::Array\<::String\>) --- Specifies the content for Access-Control-Expose-Headers header.

### #expose_headers=

    def expose_headers=(value) -> ::Array<::String>

**Parameter**

- **value** (::Array\<::String\>) --- Specifies the content for Access-Control-Expose-Headers header.
**Returns**

- (::Array\<::String\>) --- Specifies the content for Access-Control-Expose-Headers header.

### #max_age

    def max_age() -> ::String

**Returns**

- (::String) --- Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.

### #max_age=

    def max_age=(value) -> ::String

**Parameter**

- **value** (::String) --- Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.
**Returns**

- (::String) --- Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.