From 9152c595708fa9b8bb61473b3aec139ebda84c10 Mon Sep 17 00:00:00 2001 From: Gerhard Tan Date: Mon, 19 Feb 2024 13:03:37 +0800 Subject: [PATCH] fix nil map error when using plugin headers in legacy format (#3996) * fix nil map error when using plugin headers in legacy format * create map on demand * better initialization --- pkg/config/legacy/conversion.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/config/legacy/conversion.go b/pkg/config/legacy/conversion.go index 0892e4f2..dd8c4a11 100644 --- a/pkg/config/legacy/conversion.go +++ b/pkg/config/legacy/conversion.go @@ -175,6 +175,9 @@ func transformHeadersFromPluginParams(params map[string]string) v1.HeaderOperati continue } if k = strings.TrimPrefix(k, "plugin_header_"); k != "" { + if out.Set == nil { + out.Set = make(map[string]string) + } out.Set[k] = v } }