catch security errors on ie when reading hostname
This commit is contained in:
parent
46e35a9b84
commit
2bc7c42733
|
@ -145,12 +145,20 @@ export class Utils {
|
||||||
|
|
||||||
static getHostname(uriString: string): string {
|
static getHostname(uriString: string): string {
|
||||||
const url = Utils.getUrl(uriString);
|
const url = Utils.getUrl(uriString);
|
||||||
return url != null ? url.hostname : null;
|
try {
|
||||||
|
return url != null ? url.hostname : null;
|
||||||
|
} catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static getHost(uriString: string): string {
|
static getHost(uriString: string): string {
|
||||||
const url = Utils.getUrl(uriString);
|
const url = Utils.getUrl(uriString);
|
||||||
return url != null ? url.host : null;
|
try {
|
||||||
|
return url != null ? url.host : null;
|
||||||
|
} catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static getQueryParams(uriString: string): Map<string, string> {
|
static getQueryParams(uriString: string): Map<string, string> {
|
||||||
|
|
Loading…
Reference in New Issue