ActivityPub-federated video streaming platform using P2P directly in your web browser
Fix webfinger validator
Chocobozzz604abfbef5e8
diff --git a/server/helpers/core-utils.ts b/server/helpers/core-utils.tsindex 0c6c36d117..4981bb4ecb 100644--- a/server/helpers/core-utils.ts+++ b/server/helpers/core-utils.ts@@ -27,7 +27,7 @@ function sanitizeUrl (url: string) {// Don't import remote scheme from constants because we are in core utilsfunction sanitizeHost (host: string, remoteScheme: string) {- let toRemove = remoteScheme === 'https' ? 443 : 80+ const toRemove = remoteScheme === 'https' ? 443 : 80return host.replace(new RegExp(`:${toRemove}$`), '')}diff --git a/server/helpers/custom-validators/webfinger.ts b/server/helpers/custom-validators/webfinger.tsindex 46f1ac210c..d8c1232ce4 100644--- a/server/helpers/custom-validators/webfinger.ts+++ b/server/helpers/custom-validators/webfinger.ts@@ -11,8 +11,7 @@ function isWebfingerResourceValid (value: string) {if (actorParts.length !== 2) return falseconst host = actorParts[1]-- return sanitizeHost(host, REMOTE_SCHEME.HTTP) === CONFIG.WEBSERVER.HOSTNAME+ return sanitizeHost(host, REMOTE_SCHEME.HTTP) === CONFIG.WEBSERVER.HOST}// ---------------------------------------------------------------------------diff --git a/server/initializers/migrations/0140-actor-url.ts b/server/initializers/migrations/0140-actor-url.tsindex 626f3c444a..e64ee3487b 100644--- a/server/initializers/migrations/0140-actor-url.ts+++ b/server/initializers/migrations/0140-actor-url.ts@@ -1,6 +1,4 @@import * as Sequelize from 'sequelize'-import { DataType } from 'sequelize-typescript'-import { createPrivateAndPublicKeys } from '../../helpers'import { CONFIG } from '../constants'async function up (utils: {