Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions TournamentAssistantServer/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ public void ConfigureServices(IServiceCollection services)

services.AddCors(options =>
{
options.AddPolicy("AllowUsers", policy =>
{
policy.WithOrigins("http://localhost:1420", "https://tournamentassistant.net")
.AllowAnyHeader()
.AllowAnyMethod();
});
// options.AddPolicy("AllowUsers", policy =>
// {
// policy.WithOrigins("http://localhost:1420", "https://tournamentassistant.net")
// .AllowAnyHeader()
// .AllowAnyMethod();
// });

// options.AddPolicy("AllowAll", builder =>
// {
Expand All @@ -104,6 +104,16 @@ public void ConfigureServices(IServiceCollection services)
// .AllowAnyMethod()
// .AllowAnyHeader();
// });

// Allow requests from anywhere. Whoever is making a TA app should be able to fetch images from other than localhost:1420 origin
// - Luna
options.AddPolicy("AllowAll", policy =>
{
policy
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader();
});
});
}

Expand All @@ -129,8 +139,9 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
c.SwaggerEndpoint("/swagger/v1/swagger.json", "TA API v1");
});

app.UseCors("AllowUsers");
// app.UseCors("AllowAll");
// switcharooni pepperooni
// app.UseCors("AllowUsers");
app.UseCors("AllowAll");

app.UseEndpoints(endpoints =>
{
Expand Down