@@ -4,19 +4,20 @@ namespace MyApp;
44
55public class ConfigureCors : IHostingStartup
66{
7+ public static string [ ] Origins = [
8+ "http://localhost:5000" , "https://localhost:5001" , "https://localhost:5002" , "http://localhost:8080" ,
9+ "https://localhost:5173" , "http://localhost:5173" ,
10+ "https://docs.servicestack.net" , "https://servicestack.net" , "https://account.servicestack.net" ,
11+ "https://razor-ssg.web-templates.io" , "https://razor-press.web-templates.io" ,
12+ "https://press-vue.servicestack.net" , "https://press-react.servicestack.net" ,
13+ "https://vue-spa.web-templates.io" , "https://react-spa.web-templates.io" ,
14+ ] ;
715 public void Configure ( IWebHostBuilder builder ) => builder
816 . ConfigureServices ( services =>
917 {
1018 services . AddCors ( options => {
1119 options . AddDefaultPolicy ( policy => {
12- policy . WithOrigins ( [
13- "http://localhost:5000" , "https://localhost:5001" , "https://localhost:5002" , "http://localhost:8080" ,
14- "https://localhost:5173" , "http://localhost:5173" ,
15- "https://docs.servicestack.net" , "https://servicestack.net" , "https://account.servicestack.net" ,
16- "https://razor-ssg.web-templates.io" , "https://razor-press.web-templates.io" ,
17- "https://press-vue.servicestack.net" , "https://press-react.servicestack.net" ,
18- "https://vue-spa.web-templates.io" , "https://react-spa.web-templates.io" ,
19- ] )
20+ policy . WithOrigins ( Origins )
2021 . AllowCredentials ( )
2122 . WithHeaders ( [ "Content-Type" , "Allow" , "Authorization" ] )
2223 . SetPreflightMaxAge ( TimeSpan . FromHours ( 1 ) ) ;
0 commit comments