Fix: wrong usage of URL.protocol, again
This commit is contained in:
parent
493c3dd25b
commit
5a4eb7fc33
@ -34,8 +34,8 @@ export function canonicalizePluginUri (
|
|||||||
uri = new url.URL(path, options.peertubeHelpers.config.getWebserverUrl())
|
uri = new url.URL(path, options.peertubeHelpers.config.getWebserverUrl())
|
||||||
}
|
}
|
||||||
if (canonicalizeOptions?.protocol) {
|
if (canonicalizeOptions?.protocol) {
|
||||||
// Assuming that current protocol is https? or wss?, other cases dont concern us, and will be buggy
|
// Assuming that current protocol is https?: or wss?:, other cases dont concern us, and will be buggy
|
||||||
const currentProtocolSecure = uri.protocol.endsWith('s:')
|
const currentProtocolSecure = uri.protocol === 'https:' || uri.protocol === 'wss:'
|
||||||
if (canonicalizeOptions.protocol === 'http') {
|
if (canonicalizeOptions.protocol === 'http') {
|
||||||
uri.protocol = currentProtocolSecure ? 'https' : 'http'
|
uri.protocol = currentProtocolSecure ? 'https' : 'http'
|
||||||
} else if (canonicalizeOptions.protocol === 'ws') {
|
} else if (canonicalizeOptions.protocol === 'ws') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user