CorsPolicyBuilder.WithOrigins(String[]) 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.
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
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.