From 84fb49e57cd18b02a71779b12345c60d652e15be Mon Sep 17 00:00:00 2001 From: Ske Date: Tue, 7 Sep 2021 00:11:57 +0200 Subject: [PATCH] Also normalize interaction tokens in URLs --- PluralKit.Bot/Tracing/DiscordRequestObserver.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Tracing/DiscordRequestObserver.cs b/PluralKit.Bot/Tracing/DiscordRequestObserver.cs index 444d8162..801b63e0 100644 --- a/PluralKit.Bot/Tracing/DiscordRequestObserver.cs +++ b/PluralKit.Bot/Tracing/DiscordRequestObserver.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -53,6 +53,8 @@ namespace PluralKit.Bot url = Regex.Replace(url, @"/reactions/[^{/]+/\d+", "/reactions/{emoji}/{user_id}"); url = Regex.Replace(url, @"/reactions/[^{/]+", "/reactions/{emoji}"); url = Regex.Replace(url, @"/invites/[^{/]+", "/invites/{invite_code}"); + url = Regex.Replace(url, @"/interactions/\d+/[^{/]+", "/interactions/{interaction_id}/{interaction_token}"); + url = Regex.Replace(url, @"/interactions/\d+", "/interactions/{interaction_id}"); // catch-all for missed IDs url = Regex.Replace(url, @"\d{17,19}", "{snowflake}");