SearchModelFactory.CorsOptions Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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).
The duration for which browsers should cache CORS preflight responses. Defaults to 5 minutes.
Returns
A new CorsOptions instance for mocking.