mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2026-10-22 23:12:12 +03:00
Reformat list of allowed origins in CORS
This commit is contained in:
1 parent
1cf3e76644
commit
176a81e055
1 file changed
+8
-1
@@ -9,6 +9,13 @@ using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace DHT.Server.Service {
|
||||
sealed class Startup {
|
||||
private static readonly string[] AllowedOrigins = {
|
||||
"https://discord.com",
|
||||
"https://ptb.discord.com",
|
||||
"https://canary.discord.com",
|
||||
"https://discordapp.com"
|
||||
};
|
||||
|
||||
public void ConfigureServices(IServiceCollection services) {
|
||||
services.Configure<JsonOptions>(static options => {
|
||||
options.SerializerOptions.NumberHandling = JsonNumberHandling.Strict;
|
||||
@@ -16,7 +23,7 @@ namespace DHT.Server.Service {
|
||||
|
||||
services.AddCors(static cors => {
|
||||
cors.AddDefaultPolicy(static builder => {
|
||||
builder.WithOrigins("https://discord.com", "https://discordapp.com", "https://ptb.discord.com", "https://canary.discord.com").AllowCredentials().AllowAnyMethod().AllowAnyHeader();
|
||||
builder.WithOrigins(AllowedOrigins).AllowCredentials().AllowAnyMethod().AllowAnyHeader();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user