1
0
mirror of https://github.com/chylex/Discord-History-Tracker.git synced 2025-09-15 10:32:09 +02:00

4 Commits

Author SHA1 Message Date
176a81e055 Reformat list of allowed origins in CORS 2022-07-15 01:34:08 +02:00
Matojeje
1cf3e76644 Add CORS for Canary and PTB 2022-07-15 01:34:08 +02:00
33f5ab7cce Release v37.0 2022-06-18 14:00:15 +02:00
b9a5664740 Fix not seeing messages after a Discord update
Closes #189
2022-06-18 13:59:29 +02:00
3 changed files with 16 additions and 7 deletions

View File

@@ -91,11 +91,13 @@ class DISCORD {
static getMessageElementProps(ele) {
const props = DOM.getReactProps(ele);
if (props.children && props.children.length >= 4) {
const childProps = props.children[3].props;
if ("message" in childProps && "channel" in childProps) {
return childProps;
if (props.children && props.children.length) {
for (let i = 3; i < props.children.length; i++) {
const childProps = props.children[i].props;
if (childProps && "message" in childProps && "channel" in childProps) {
return childProps;
}
}
}

View File

@@ -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").AllowCredentials().AllowAnyMethod().AllowAnyHeader();
builder.WithOrigins(AllowedOrigins).AllowCredentials().AllowAnyMethod().AllowAnyHeader();
});
});
}

View File

@@ -7,6 +7,6 @@ using DHT.Utils;
namespace DHT.Utils {
static class Version {
public const string Tag = "36.2.0.0";
public const string Tag = "37.0.0.0";
}
}