From 46a8840bb4b3ed9b81ac65d3351debc4e34f30ce Mon Sep 17 00:00:00 2001 From: Gary Caldwell Date: Tue, 16 Feb 2021 08:28:30 -0800 Subject: [PATCH] fix: Look for the Amazon cred header to remove auth header (#5594) --- packages/builder-util-runtime/src/httpExecutor.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/builder-util-runtime/src/httpExecutor.ts b/packages/builder-util-runtime/src/httpExecutor.ts index f6ae8a80279..b345726235a 100644 --- a/packages/builder-util-runtime/src/httpExecutor.ts +++ b/packages/builder-util-runtime/src/httpExecutor.ts @@ -299,8 +299,9 @@ Please double check that your authentication token is correct. Due to security r const headers = newOptions.headers if (headers != null && headers.authorization != null && (headers.authorization as string).startsWith("token")) { const parsedNewUrl = new URL(redirectUrl) - if (parsedNewUrl.hostname.endsWith(".amazonaws.com")) { - delete headers.authorization + if (parsedNewUrl.hostname.endsWith(".amazonaws.com") || + parsedNewUrl.searchParams.has("X-Amz-Credential")) { + delete headers.authorization; } } return newOptions @@ -483,4 +484,4 @@ export function safeStringifyJson(data: any, skippedNames?: Set) { } return value }, 2) -} \ No newline at end of file +}