From 12897f74316d3322ade5b33d6fbed61180db0ef7 Mon Sep 17 00:00:00 2001 From: Harshini K S Date: Fri, 29 Jan 2021 18:11:47 +0530 Subject: [PATCH 1/3] Remove the auth header when Amz algorithm is already in place --- Tasks/DownloadGitHubReleaseV0/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/DownloadGitHubReleaseV0/main.ts b/Tasks/DownloadGitHubReleaseV0/main.ts index 66c53e3ce9d3..b00d60212f2a 100644 --- a/Tasks/DownloadGitHubReleaseV0/main.ts +++ b/Tasks/DownloadGitHubReleaseV0/main.ts @@ -145,7 +145,7 @@ async function main(): Promise { canHandleAuthentication: () => false, handleAuthentication: () => { }, prepareRequest: (options) => { - if (options.host.indexOf("amazonaws") == -1) { + if (options.host.indexOf("X-Amz-Algorithm") == -1) { options.headers['Authorization'] = 'Bearer ' + token; } else { From 177647ccb4d24b028f3737e6584bca29d1e949f2 Mon Sep 17 00:00:00 2001 From: Harshini K S Date: Fri, 29 Jan 2021 18:12:58 +0530 Subject: [PATCH 2/3] Patch new version --- Tasks/DownloadGitHubReleaseV0/task.json | 2 +- Tasks/DownloadGitHubReleaseV0/task.loc.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tasks/DownloadGitHubReleaseV0/task.json b/Tasks/DownloadGitHubReleaseV0/task.json index 4a66869e0b34..a6971eb50008 100644 --- a/Tasks/DownloadGitHubReleaseV0/task.json +++ b/Tasks/DownloadGitHubReleaseV0/task.json @@ -11,7 +11,7 @@ "version": { "Major": 0, "Minor": 160, - "Patch": 2 + "Patch": 3 }, "minimumAgentVersion": "1.99.0", "instanceNameFormat": "Download GitHub Release", diff --git a/Tasks/DownloadGitHubReleaseV0/task.loc.json b/Tasks/DownloadGitHubReleaseV0/task.loc.json index af87beb4efc0..8ec4332273c8 100644 --- a/Tasks/DownloadGitHubReleaseV0/task.loc.json +++ b/Tasks/DownloadGitHubReleaseV0/task.loc.json @@ -11,7 +11,7 @@ "version": { "Major": 0, "Minor": 160, - "Patch": 2 + "Patch": 3 }, "minimumAgentVersion": "1.99.0", "instanceNameFormat": "ms-resource:loc.instanceNameFormat", From 979ff2dbae605006757642cf73bea903b41d9622 Mon Sep 17 00:00:00 2001 From: Harshini K S Date: Fri, 29 Jan 2021 18:25:04 +0530 Subject: [PATCH 3/3] Add comments --- Tasks/DownloadGitHubReleaseV0/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tasks/DownloadGitHubReleaseV0/main.ts b/Tasks/DownloadGitHubReleaseV0/main.ts index b00d60212f2a..ffb29cb5f860 100644 --- a/Tasks/DownloadGitHubReleaseV0/main.ts +++ b/Tasks/DownloadGitHubReleaseV0/main.ts @@ -145,7 +145,8 @@ async function main(): Promise { canHandleAuthentication: () => false, handleAuthentication: () => { }, prepareRequest: (options) => { - if (options.host.indexOf("X-Amz-Algorithm") == -1) { + //To handle single auth being used at a time, add Auth header only when X-AMZ is not used + if (options.host.indexOf("amazonaws") == -1 && options.path.indexOf("X-Amz-Algorithm") == -1) { options.headers['Authorization'] = 'Bearer ' + token; } else {