Merge pull request #24000 from stevez/fix-issue-23999

Fix for #23999 - 'req.header is not a function'
This commit is contained in:
Fredrik Adelöw
2024-04-15 07:55:39 +02:00
committed by GitHub
2 changed files with 8 additions and 2 deletions
@@ -182,8 +182,9 @@ export class KubernetesProxy {
)?.toString(),
};
const authHeader = req.header(HEADER_KUBERNETES_AUTH);
if (authHeader) {
const authHeader =
req.headers[HEADER_KUBERNETES_AUTH.toLocaleLowerCase('en-US')];
if (typeof authHeader === 'string') {
req.headers.authorization = authHeader;
} else {
// Map Backstage-Kubernetes-Authorization-X-X headers to a KubernetesRequestAuth object