get authHeader using req.headers instead

Signed-off-by: Steve Zhang <huigang.zhang@gmail.com>
This commit is contained in:
Steve Zhang
2024-04-11 09:27:07 -04:00
parent b0865c7cd7
commit b94aefccf1
@@ -172,8 +172,9 @@ export class KubernetesProxy {
)?.toString(),
};
const authHeader = req.header?.(HEADER_KUBERNETES_AUTH);
if (authHeader) {
const authHeader =
req.headers[HEADER_KUBERNETES_AUTH.toLocaleLowerCase()];
if (typeof authHeader === 'string') {
req.headers.authorization = authHeader;
} else {
// Map Backstage-Kubernetes-Authorization-X-X headers to a KubernetesRequestAuth object