1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-06 00:48:08 +02:00

Modified response to include port if exists

This commit is contained in:
Matt Smith 2020-07-13 13:35:37 -05:00
parent 7561f6dcb5
commit 58ba1ce5b6

View File

@ -157,7 +157,13 @@ export class Utils {
static getHostname(uriString: string): string {
const url = Utils.getUrl(uriString);
try {
return url != null && url.hostname !== '' ? url.hostname : null;
let hostname = url != null && url.hostname !== '' ? url.hostname : null;
if(hostname != null && url.port !== '') {
hostname += ":" + url.port;
}
return hostname;
} catch {
return null;
}