Преглед изворни кода

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
Gerhard Tan пре 11 месеци
родитељ
комит
9152c59570
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      pkg/config/legacy/conversion.go

+ 3 - 0
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
 		}
 	}