Fix protocol detection.

This commit is contained in:
John Livingston 2023-04-21 18:38:43 +02:00
parent 6e290a3ef6
commit ba573c1211
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC

View File

@ -35,7 +35,7 @@ export function canonicalizePluginUri (
}
if (canonicalizeOptions?.protocol) {
// 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') {
uri.protocol = currentProtocolSecure ? 'https' : 'http'
} else if (canonicalizeOptions.protocol === 'ws') {