mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 20:26:19 +02:00
use URL instead of creating new a element
This commit is contained in:
parent
c2791b9470
commit
d3f0b609f5
@ -260,12 +260,7 @@ function getServerName(userId) {
|
||||
|
||||
function getHostnameFromMatrixDomain(domain) {
|
||||
if (!domain) return null;
|
||||
|
||||
// The hostname might have a port, so we convert it to a URL and
|
||||
// split out the real hostname.
|
||||
const parser = document.createElement('a');
|
||||
parser.href = "https://" + domain;
|
||||
return parser.hostname;
|
||||
return new URL(`https://${domain}`).hostname;
|
||||
}
|
||||
|
||||
function isHostInRegex(hostname, regexps) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user