fix(identity/aws-auth): allow for lowercase authoriazation header

This commit is contained in:
Daniel Hougaard
2025-06-09 19:45:05 +04:00
parent 130f1a167e
commit 69392a4a51
2 changed files with 3 additions and 2 deletions

View File

@@ -94,7 +94,7 @@ export const identityAwsAuthServiceFactory = ({
const headers: TAwsGetCallerIdentityHeaders = JSON.parse(Buffer.from(iamRequestHeaders, "base64").toString());
const body: string = Buffer.from(iamRequestBody, "base64").toString();
const region = headers.Authorization ? awsRegionFromHeader(headers.Authorization) : null;
const region = headers.authorization ? awsRegionFromHeader(headers.Authorization || headers.authorization) : null;
if (!isValidAwsRegion(region)) {
throw new BadRequestError({ message: "Invalid AWS region" });

View File

@@ -40,7 +40,8 @@ export type TAwsGetCallerIdentityHeaders = {
"X-Amz-Date": string;
"Content-Length": number;
"x-amz-security-token": string;
Authorization: string;
Authorization?: string;
authorization?: string;
};
export type TGetCallerIdentityResponse = {