diff --git a/ctxvml.go b/ctxvml.go index d07ecf9..ba4c7dd 100644 --- a/ctxvml.go +++ b/ctxvml.go @@ -53,7 +53,7 @@ func (ss serverStreamWithContext) Context() context.Context { func extractMetadataToContext(ctx context.Context) context.Context { md, _ := metadata.FromIncomingContext(ctx) headers := VmlHeaders{} - if mdValue, ok := md["x-ssn-username"]; ok { + if mdValue, ok := md["vml-username"]; ok { headers.Username = mdValue[0] grpc_ctxtags.Extract(ctx).Set("username", mdValue[0]) ctx = context.WithValue(ctx, ctxMarkerKey, headers) @@ -91,7 +91,7 @@ func StreamClientInterceptor() grpc.StreamClientInterceptor { func packCallerMetadata(ctx context.Context) map[string]string { var md = map[string]string{} headers := Extract(ctx) - md["x-ssn-username"] = headers.Username + md["vml-username"] = headers.Username return md } diff --git a/ctxvml_test.go b/ctxvml_test.go index ca6a69a..b45d2cc 100644 --- a/ctxvml_test.go +++ b/ctxvml_test.go @@ -12,7 +12,7 @@ func TestPackMetadata(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), time.Second*30) defer cancel() ctx = metadata.AppendToOutgoingContext(ctx, "Authorization", "sup3rS3cr37") - ctx = WithValue(ctx, SsnHeaders{ + ctx = WithValue(ctx, VmlHeaders{ Username: "JohnDoe", }) md := packCallerMetadata(ctx)