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
1 changed files with 7 additions and 1 deletions

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;
}