Skip to content

Commit

Permalink
remove x and ssn from header
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobSMoller committed May 27, 2019
1 parent 695a037 commit 264e47e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ctxvml.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion ctxvml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 264e47e

Please sign in to comment.