Merge pull request 'Fix remote url resolving issue' (#366) from rajitha/device-mgt-core:stream-api into master

Reviewed-on: https://repository.entgra.net/community/device-mgt-core/pulls/366
This commit is contained in:
Pahansith Gunathilake 2024-04-02 10:03:48 +00:00
commit a77c092645

View File

@ -166,9 +166,10 @@ public class FileTransferServiceHelperUtil {
throw new FileTransferServiceHelperUtilException("Received null for download url");
}
if (!Objects.equals(System.getProperty("iot.gateway.host"), downloadUrl.getHost())) {
if (!Objects.equals(System.getProperty("iot.gateway.host"), downloadUrl.getHost()) &&
!Objects.equals(System.getProperty("iot.core.host"), downloadUrl.getHost())) {
if (log.isDebugEnabled()) {
log.debug("Host not match with " + System.getProperty("iot.gateway.host"));
log.debug("Download URL " + downloadUrl + " contains not matching host");
}
return null;
}