mirror of
https://github.com/chylex/Discord-History-Tracker.git
synced 2024-11-25 14:42:44 +01:00
Compare commits
2 Commits
33f5ab7cce
...
176a81e055
Author | SHA1 | Date | |
---|---|---|---|
176a81e055 | |||
|
1cf3e76644 |
@ -9,6 +9,13 @@ using Microsoft.Extensions.Hosting;
|
|||||||
|
|
||||||
namespace DHT.Server.Service {
|
namespace DHT.Server.Service {
|
||||||
sealed class Startup {
|
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) {
|
public void ConfigureServices(IServiceCollection services) {
|
||||||
services.Configure<JsonOptions>(static options => {
|
services.Configure<JsonOptions>(static options => {
|
||||||
options.SerializerOptions.NumberHandling = JsonNumberHandling.Strict;
|
options.SerializerOptions.NumberHandling = JsonNumberHandling.Strict;
|
||||||
@ -16,7 +23,7 @@ namespace DHT.Server.Service {
|
|||||||
|
|
||||||
services.AddCors(static cors => {
|
services.AddCors(static cors => {
|
||||||
cors.AddDefaultPolicy(static builder => {
|
cors.AddDefaultPolicy(static builder => {
|
||||||
builder.WithOrigins("https://discord.com", "https://discordapp.com").AllowCredentials().AllowAnyMethod().AllowAnyHeader();
|
builder.WithOrigins(AllowedOrigins).AllowCredentials().AllowAnyMethod().AllowAnyHeader();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user