istio-config/uralkal: harden decode-zitadel-headers — replace only with numeric ids, drop the header otherwise

This commit is contained in:
emelinda 2026-11-08 22:54:49 +03:00
parent 4ca206722b
commit d49f178603

View File

@ -196,8 +196,13 @@ spec:
end
local decoded = base64_decode(value)
if decoded and decoded ~= "" then
-- Отличие от prod: заменяем только на ожидаемый вид (id/список id),
-- иначе удаляем заголовок — мусорные байты валят приложение
-- ("invalid header value for: x-user-id").
if decoded and decoded:match("^[%d,]+$") then
handle:headers():replace(header_name, decoded)
else
handle:headers():remove(header_name)
end
end