Chat federation metadata fix, and code refactoring.
This commit is contained in:
10
server/lib/uri/canonicalize.ts
Normal file
10
server/lib/uri/canonicalize.ts
Normal 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()
|
||||
}
|
Reference in New Issue
Block a user