1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-30 16:34:16 +00:00

Don't overwrite original variable

This commit is contained in:
Chocobo1 2023-06-02 18:12:01 +08:00
parent 5cea69472f
commit dad9157d84
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C

View File

@ -116,8 +116,7 @@ function getHost(url) {
try { try {
// hack: URL can not get hostname from udp protocol // hack: URL can not get hostname from udp protocol
url = url.replace(/^udp:/, 'https:'); const parsedUrl = new URL(url.replace(/^udp:/, 'https:'));
const parsedUrl = new URL(url);
// host: "example.com:8443" // host: "example.com:8443"
// hostname: "example.com" // hostname: "example.com"
const host = parsedUrl.hostname; const host = parsedUrl.hostname;