summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-07-31 12:18:27 +0200
committerLibravatar GitHub <noreply@github.com>2023-07-31 12:18:27 +0200
commitde148e9f9fe00f4a951f40e01b60bdb31fc70692 (patch)
tree770d4f23e8dcfd9d76d2ee24f7dff1aec85a3885
parent[chore]: Bump github.com/abema/go-mp4 from 0.10.2-0.20230727031202-a1a707db6e... (diff)
downloadgotosocial-de148e9f9fe00f4a951f40e01b60bdb31fc70692.tar.xz
[bugfix/frontend] Decode URI component domain before showing on frontend (#2043)
-rw-r--r--web/source/settings/admin/federation/detail.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/web/source/settings/admin/federation/detail.js b/web/source/settings/admin/federation/detail.js
index 0c6d29522..344b9f9b6 100644
--- a/web/source/settings/admin/federation/detail.js
+++ b/web/source/settings/admin/federation/detail.js
@@ -38,11 +38,14 @@ module.exports = function InstanceDetail({ baseUrl }) {
const { data: blockedInstances = {}, isLoading } = query.useInstanceBlocksQuery();
let [_match, { domain }] = useRoute(`${baseUrl}/:domain`);
-
- if (domain == "view") { // from form field submission
+ if (domain == "view") {
+ // Retrieve domain from form field submission.
domain = (new URL(document.location)).searchParams.get("domain");
}
+ // Normalize / decode domain (it may be URL-encoded).
+ domain = decodeURIComponent(domain);
+
const existingBlock = React.useMemo(() => {
return blockedInstances[domain];
}, [blockedInstances, domain]);