Only add ":" when a port is given
Before if no port was given, the HOST field would look like
"9.41.165.233:". Added a check for a port before adding a ":".
Resolves openbmc/openbmc#2995
Tested: Flashed an image with this change on a Witherspoon
and verified no ":" when no port was given. Also, verified
displayed data and log in looked good.
Change-Id: I315c73489d419aacc041218e971e75d21ff6c255
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/common/services/dataService.js b/app/common/services/dataService.js
index 2672c0e..201e79c 100644
--- a/app/common/services/dataService.js
+++ b/app/common/services/dataService.js
@@ -47,8 +47,8 @@
return sessionStorage.getItem(Constants.API_CREDENTIALS.host_storage_key);
}else{
return Constants.API_CREDENTIALS.default_protocol + "://" +
- window.location.hostname + ':' +
- window.location.port;
+ window.location.hostname +
+ (window.location.port ? ":" + window.location.port : "");
}
}