From 1ec164c29721740cfe9e092b177411526c87199d Mon Sep 17 00:00:00 2001 From: "Jason C.H" Date: Sun, 21 Jul 2019 15:40:00 +0800 Subject: [PATCH] Fix trim prefix in bm metadata parsing --- pkg/net/http/blademaster/metadata.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/net/http/blademaster/metadata.go b/pkg/net/http/blademaster/metadata.go index 0ce65d102..24139dc35 100644 --- a/pkg/net/http/blademaster/metadata.go +++ b/pkg/net/http/blademaster/metadata.go @@ -52,7 +52,7 @@ var _parser = map[string]func(string) interface{}{ func parseMetadataTo(req *http.Request, to metadata.MD) { for rawKey := range req.Header { - key := strings.ReplaceAll(strings.TrimLeft(strings.ToLower(rawKey), _httpHeaderMetadata), "-", "_") + key := strings.ReplaceAll(strings.TrimPrefix(strings.ToLower(rawKey), _httpHeaderMetadata), "-", "_") rawValue := req.Header.Get(rawKey) var value interface{} = rawValue parser, ok := _parser[key]