From b106778e054e9de930e5603dd02451cf735eb05d Mon Sep 17 00:00:00 2001 From: Rory Shanks <6383578+rorylshanks@users.noreply.github.com> Date: Fri, 22 Mar 2024 14:06:47 +0100 Subject: [PATCH] Fixed header map file cache issue (#31) --- lib/authz.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/authz.js b/lib/authz.js index 4712788..d2626a1 100644 --- a/lib/authz.js +++ b/lib/authz.js @@ -83,7 +83,7 @@ async function addRequestedHeaders(req, res, route, user, discoveredGroups) { async function getRequestHeaderMapConfig(user, route) { var userId = user.id var userGroups = user.groups - var requestHeaderMap = requestHeaderMapCache.get(`${userId}-${route}`) + var requestHeaderMap = requestHeaderMapCache.get(`${userId}-${JSON.stringify(route)}`) if (requestHeaderMap) { log.trace("Returning requestHeaderMap from cache") return requestHeaderMap @@ -111,7 +111,7 @@ async function getRequestHeaderMapConfig(user, route) { ...requestHeaderMap[userId], } } - requestHeaderMapCache.put(`${userId}-${route}`, result) + requestHeaderMapCache.put(`${userId}-${JSON.stringify(route)}`, result) return result } catch (error) { log.error({ message: "Unable to get config for requestHeaderMap", context: { error: error.message, stack: error.stack, route: route } })