Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  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. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement