diff --git a/drivers/plugins/http-to-gRPC/complete.go b/drivers/plugins/http-to-gRPC/complete.go index 7f92c381..d832a24d 100644 --- a/drivers/plugins/http-to-gRPC/complete.go +++ b/drivers/plugins/http-to-gRPC/complete.go @@ -183,7 +183,7 @@ type StatusErr struct { func httpHeaderToMD(headers http.Header, additionalHeader map[string]string) []string { headers.Set("content-type", "application/grpc") headers.Del("connection") - md := make([]string, len(headers)+len(additionalHeader)) + md := make([]string, 0, len(headers)+len(additionalHeader)) //md := metadata.New(map[string]string{}) for key, value := range headers { if strings.ToLower(key) == "user-agent" { diff --git a/node/http-context/header.go b/node/http-context/header.go index 41771777..e9b4233d 100644 --- a/node/http-context/header.go +++ b/node/http-context/header.go @@ -159,10 +159,8 @@ func (r *ResponseHeader) Headers() http.Header { func (r *ResponseHeader) SetHeader(key, value string) { r.cache.Set(key, value) - - if r.afterProxy { - r.header.Set(key, value) - } else { + r.header.Set(key, value) + if !r.afterProxy { r.actions = append(r.actions, &headerAction{ Key: key, Value: value,