Chat federation metadata fix, and code refactoring.

This commit is contained in:
John Livingston
2023-04-20 11:10:23 +02:00
parent 115fcd8484
commit 4c138f3f5b

View File

@ -0,0 +1,10 @@
import type { RegisterServerOptions } from '@peertube/peertube-types'
import * as url from 'url'
export function fullUri (options: RegisterServerOptions, path: string): string {
if (path.startsWith('https://') || path.startsWith('http://')) {
return path
}
const uri = new url.URL(path, options.peertubeHelpers.config.getWebserverUrl())
return uri.toString()
}