Skip to content

Commit

Permalink
fix: Look for the Amazon cred header to remove auth header (#5594)
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryCaldwell authored Feb 16, 2021
1 parent 0ba839b commit 46a8840
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/builder-util-runtime/src/httpExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -483,4 +484,4 @@ export function safeStringifyJson(data: any, skippedNames?: Set<string>) {
}
return value
}, 2)
}
}

0 comments on commit 46a8840

Please sign in to comment.