From 215a3096db71fc79d1e97ccd74d9c79529b728b6 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Mon, 3 Oct 2022 22:24:12 -0700 Subject: [PATCH] Do not allow enabling federation features on if not port 443. Closes #2008 --- web/pages/admin/config-federation.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/web/pages/admin/config-federation.tsx b/web/pages/admin/config-federation.tsx index f2ca41c3f..ca8237391 100644 --- a/web/pages/admin/config-federation.tsx +++ b/web/pages/admin/config-federation.tsx @@ -244,6 +244,18 @@ const ConfigFederation = () => { /> ); + + const invalidPortWarning = ( + + ); + + const hasInvalidPort = + instanceUrl && new URL(instanceUrl).port !== '' && new URL(instanceUrl).port !== '443'; + return (
Configure Social Features @@ -263,12 +275,13 @@ const ConfigFederation = () => { {configurationWarning} + {hasInvalidPort && invalidPortWarning} { useSubmit {...FIELD_PROPS_FEDERATION_NSFW} checked={formDataValues.nsfw} - disabled={!hasInstanceUrl} + disabled={hasInvalidPort || !hasInstanceUrl} />