SHARE
TWEET

Untitled

a guest Sep 15th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. services.AddCors(
  3.     options => options.AddPolicy(
  4.         "CorsPolicy",
  5.         builder =>
  6.         {
  7.             builder.AllowAnyMethod()
  8.                 .AllowAnyHeader()
  9.                 .WithOrigins(
  10.                     Configuration
  11.                         .GetSection(
  12.                             "Cors:Hosts"
  13.                         ).GetChildren(
  14.  
  15.                         ).AsEnumerable(
  16.  
  17.                         ).Select(
  18.                             a => a.Value
  19.                         ).ToArray()
  20.                 )
  21.                 .AllowCredentials();
  22.         }
  23.     )
  24. );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top