many lint fixes and optimizations (#17)
* util/kubernetes: drop stale files * debug/log/kubernetes: drop stale files * util/scope: remove stale files * util/mdns: drop stale files * lint fixes Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -60,10 +60,9 @@ func NewRoundTripper(opts ...Option) http.RoundTripper {
|
||||
// RequestToContext puts the `Authorization` header bearer token into context
|
||||
// so calls to services will be authorized.
|
||||
func RequestToContext(r *http.Request) context.Context {
|
||||
ctx := context.Background()
|
||||
md := make(metadata.Metadata)
|
||||
md := metadata.New(len(r.Header))
|
||||
for k, v := range r.Header {
|
||||
md[k] = strings.Join(v, ",")
|
||||
md.Set(k, strings.Join(v, ","))
|
||||
}
|
||||
return metadata.NewContext(ctx, md)
|
||||
return metadata.NewIncomingContext(r.Context(), md)
|
||||
}
|
||||
|
Reference in New Issue
Block a user