(host)
| 1286 | return url; |
| 1287 | } |
| 1288 | function getHostname(host) { |
| 1289 | if (host[0] === "[") { |
| 1290 | const idx2 = host.indexOf("]"); |
| 1291 | assert(idx2 !== -1); |
| 1292 | return host.substring(1, idx2); |
| 1293 | } |
| 1294 | const idx = host.indexOf(":"); |
| 1295 | if (idx === -1) |
| 1296 | return host; |
| 1297 | return host.substring(0, idx); |
| 1298 | } |
| 1299 | function getServerName(host) { |
| 1300 | if (!host) { |
| 1301 | return null; |