SearchModelFactory.CorsOptions Method

Definition

Defines options to control Cross-Origin Resource Sharing (CORS) for an index.

public static Azure.Search.Documents.Indexes.Models.CorsOptions CorsOptions(System.Collections.Generic.IEnumerable<string> allowedOrigins = default, long? maxAgeInSeconds = default);
static member CorsOptions : seq<string> * Nullable<int64> -> Azure.Search.Documents.Indexes.Models.CorsOptions
Public Shared Function CorsOptions (Optional allowedOrigins As IEnumerable(Of String) = Nothing, Optional maxAgeInSeconds As Nullable(Of Long) = Nothing) As CorsOptions

Parameters

allowedOrigins
IEnumerable<String>

The list of origins from which JavaScript code will be granted access to your index. Can contain a list of hosts of the form {protocol}://{fully-qualified-domain-name}[:{port#}], or a single '*' to allow all origins (not recommended).

maxAgeInSeconds
Nullable<Int64>

The duration for which browsers should cache CORS preflight responses. Defaults to 5 minutes.

Returns

A new CorsOptions instance for mocking.

Applies to