Fix protocol detection.
This commit is contained in:
parent
6e290a3ef6
commit
ba573c1211
@ -35,7 +35,7 @@ export function canonicalizePluginUri (
|
|||||||
}
|
}
|
||||||
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.endsWith('s:')
|
||||||
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