refactor: improve code formatting and readability across multiple files

This commit is contained in:
jeetul.samaiya 2025-09-01 12:15:37 +05:30
commit cb8c45456b

View file

@ -93,13 +93,17 @@ const getHttpHeaders = (req: express.Request): Record<string, string> => {
// Handle multiple custom headers (new approach)
if (req.headers["x-custom-auth-headers"] !== undefined) {
try {
const customHeaderNames = JSON.parse(req.headers["x-custom-auth-headers"] as string) as string[];
const customHeaderNames = JSON.parse(
req.headers["x-custom-auth-headers"] as string,
) as string[];
if (Array.isArray(customHeaderNames)) {
customHeaderNames.forEach((headerName) => {
const lowerCaseHeaderName = headerName.toLowerCase();
if (req.headers[lowerCaseHeaderName] !== undefined) {
const value = req.headers[lowerCaseHeaderName];
headers[headerName] = Array.isArray(value) ? value[value.length - 1] : value;
headers[headerName] = Array.isArray(value)
? value[value.length - 1]
: value;
}
});
}