1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 02:09:37 +02:00

Sanitize url to not end with implicit ports

This commit is contained in:
Chocobozzz 2017-12-21 09:56:59 +01:00
parent 6725d05c5f
commit 225a89c2af
No known key found for this signature in database
GPG key ID: 583A612D890159BE
5 changed files with 122 additions and 58 deletions

View file

@ -1,4 +1,5 @@
import { CONFIG } from '../../initializers'
import { CONFIG, REMOTE_SCHEME } from '../../initializers'
import { sanitizeHost } from '../core-utils'
import { exists } from './misc'
function isWebfingerResourceValid (value: string) {
@ -11,7 +12,7 @@ function isWebfingerResourceValid (value: string) {
const host = actorParts[1]
return host === CONFIG.WEBSERVER.HOSTNAME || host === CONFIG.WEBSERVER.HOST
return sanitizeHost(host, REMOTE_SCHEME.HTTP) === CONFIG.WEBSERVER.HOSTNAME
}
// ---------------------------------------------------------------------------