Fix webfinger validator

This commit is contained in:
Chocobozzz 2017-12-21 10:16:20 +01:00
parent 225a89c2af
commit 604abfbef5
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 2 additions and 5 deletions

View File

@ -27,7 +27,7 @@ function sanitizeUrl (url: string) {
// Don't import remote scheme from constants because we are in core utils
function sanitizeHost (host: string, remoteScheme: string) {
let toRemove = remoteScheme === 'https' ? 443 : 80
const toRemove = remoteScheme === 'https' ? 443 : 80
return host.replace(new RegExp(`:${toRemove}$`), '')
}

View File

@ -11,8 +11,7 @@ function isWebfingerResourceValid (value: string) {
if (actorParts.length !== 2) return false
const host = actorParts[1]
return sanitizeHost(host, REMOTE_SCHEME.HTTP) === CONFIG.WEBSERVER.HOSTNAME
return sanitizeHost(host, REMOTE_SCHEME.HTTP) === CONFIG.WEBSERVER.HOST
}
// ---------------------------------------------------------------------------

View File

@ -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: {