few changes on download api

revert-70aa11f8
ayyoob 9 years ago
parent 1c0807a513
commit 5e1ad22480

@ -50,6 +50,7 @@ if (!user) {
if (deviceTypeConfig && deviceTypeConfig.deviceType.downloadAgentUri) { if (deviceTypeConfig && deviceTypeConfig.deviceType.downloadAgentUri) {
sketchDownloadEndPoint = devicemgtProps["httpsURL"] + "/" + deviceTypeConfig.deviceType.downloadAgentUri; sketchDownloadEndPoint = devicemgtProps["httpsURL"] + "/" + deviceTypeConfig.deviceType.downloadAgentUri;
serviceInvokers.HttpClient.get(sketchDownloadEndPoint + queryString, function (responsePayload, responseHeaders) { serviceInvokers.HttpClient.get(sketchDownloadEndPoint + queryString, function (responsePayload, responseHeaders) {
if (responseHeaders) {
for (var i = 0; i < responseHeaders.length; i++) { for (var i = 0; i < responseHeaders.length; i++) {
var header = responseHeaders[i] var header = responseHeaders[i]
var headerName = String(header.getName()); var headerName = String(header.getName());
@ -58,12 +59,15 @@ if (!user) {
} }
var streamObject = new Stream(responsePayload); var streamObject = new Stream(responsePayload);
print(streamObject); print(streamObject);
}, function (responsePayload) { } else {
log.error(responsePayload) return responsePayload;
var response = {};
response["status"] = "error";
return response;
} }
}, function (responsePayload) {
log.error(responsePayload)
var response = {};
response["status"] = "error";
return response;
}
); );
} else { } else {
result = 400; result = 400;

Loading…
Cancel
Save