aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers')
-rw-r--r--server/helpers/core-utils.ts2
-rw-r--r--server/helpers/custom-validators/webfinger.ts3
2 files changed, 2 insertions, 3 deletions
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.ts
index 0c6c36d11..4981bb4ec 100644
--- a/server/helpers/core-utils.ts
+++ b/server/helpers/core-utils.ts
@@ -27,7 +27,7 @@ function sanitizeUrl (url: string) {
27 27
28// Don't import remote scheme from constants because we are in core utils 28// Don't import remote scheme from constants because we are in core utils
29function sanitizeHost (host: string, remoteScheme: string) { 29function sanitizeHost (host: string, remoteScheme: string) {
30 let toRemove = remoteScheme === 'https' ? 443 : 80 30 const toRemove = remoteScheme === 'https' ? 443 : 80
31 31
32 return host.replace(new RegExp(`:${toRemove}$`), '') 32 return host.replace(new RegExp(`:${toRemove}$`), '')
33} 33}
diff --git a/server/helpers/custom-validators/webfinger.ts b/server/helpers/custom-validators/webfinger.ts
index 46f1ac210..d8c1232ce 100644
--- a/server/helpers/custom-validators/webfinger.ts
+++ b/server/helpers/custom-validators/webfinger.ts
@@ -11,8 +11,7 @@ function isWebfingerResourceValid (value: string) {
11 if (actorParts.length !== 2) return false 11 if (actorParts.length !== 2) return false
12 12
13 const host = actorParts[1] 13 const host = actorParts[1]
14 14 return sanitizeHost(host, REMOTE_SCHEME.HTTP) === CONFIG.WEBSERVER.HOST
15 return sanitizeHost(host, REMOTE_SCHEME.HTTP) === CONFIG.WEBSERVER.HOSTNAME
16} 15}
17 16
18// --------------------------------------------------------------------------- 17// ---------------------------------------------------------------------------