Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also Look for the Amazon cred header to remove auth header #5594

Merged
merged 1 commit into from
Feb 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
}