CorsPolicyBuilder.WithOrigins(String[]) Method

Definition

Adds the specified origins to the policy.

public:
 Microsoft::AspNetCore::Cors::Infrastructure::CorsPolicyBuilder ^ WithOrigins(... cli::array <System::String ^> ^ origins);
public Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder WithOrigins (params string[] origins);
member this.WithOrigins : string[] -> Microsoft.AspNetCore.Cors.Infrastructure.CorsPolicyBuilder
Public Function WithOrigins (ParamArray origins As String()) As CorsPolicyBuilder

Parameters

origins
String[]

The origins that are allowed.

Returns

CorsPolicyBuilder

The current policy builder.

Remarks

This method normalizes the origin value prior to adding it to Origins to match the normalization performed by the browser on the value sent in the ORIGIN header.

Applies to