Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Bingbing
2025-12-24 17:38:39 +08:00
committed by GitHub
parent 47b2f00cc6
commit 094e6eabc6

View File

@@ -6,7 +6,7 @@ const DEFAULT_PORT = 443;
export function urlMatchesCertHost(certificateHost: string, requestUrl: string, needCheckPort = true) {
const cHostWithProtocol = setDefaultProtocol(certificateHost, 'https:');
let hostname: string | null = null;
let hostname: string = '';
let port = '';
try {
const parsedUrl = new URL(requestUrl);