mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-11-25 18:20:31 -06:00
Fix webfinger validator
This commit is contained in:
parent
225a89c2af
commit
604abfbef5
@ -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}$`), '')
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -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: {
|
||||
|
Loading…
Reference in New Issue
Block a user