su-downloader3
su-downloader3 copied to clipboard
403 Error in HEAD request
Hi, While downloading the tool which required an authentication token, it failed in HEAD request and response came as 403 error and while checking in the server-side, we found that the authentication token is not passing in HEAD request. Code snippet I user like below:
options = {
threads: 1,
throttleRate: 300,
headers: {
Authorization: `Bearer ${global.downloadToken}`,
}
var schedulerOptions = {
autoStart: true,
maxConcurrentDownloads: 5,
downloadOptions: options,
};
var locations = { url, savePath };
const suDScheduler = new SuDScheduler(schedulerOptions);
const toolID = tool.featureId + tool.version; // unique tool ID for track all download status
suDScheduler.queueDownload(toolID, locations, {
next: progressInfo => {
if (progressInfo.savePath) {
// first time call only
} else {
// 2nd time onwards
}
},
error: e => {
logger.error(e);
},
complete: () => {
// final call after download
},
});
Do you have a solution to this issue? Please help us to find the proper solution. If you need more information please let me know as well. Thanks in advance.