git » remoteu2f » commit a9778ce

proxy: Update to the new GRPC metadata API

author Alberto Bertogli
2017-08-22 10:34:00 UTC
committer Alberto Bertogli
2017-08-22 10:34:00 UTC
parent 86fff29ff955b80bc05db0415c39c2464af44e8b

proxy: Update to the new GRPC metadata API

metadata.FromContext has been deprecated, for our use case we need to
call metadata.FromIncomingContext instead.

https://github.com/grpc/grpc-go/pull/1392
https://github.com/grpc/proposal/pull/25/commits/c8857c2848c0794c6b75675a1c446640cfd4bd30

remoteu2f-proxy/server.go +1 -1

diff --git a/remoteu2f-proxy/server.go b/remoteu2f-proxy/server.go
index 7c8f1a7..c63e82d 100644
--- a/remoteu2f-proxy/server.go
+++ b/remoteu2f-proxy/server.go
@@ -116,7 +116,7 @@ func (s *Server) getOp(key string) (*PendingOp, bool) {
 }
 
 func (s *Server) checkOauth(ctx context.Context) error {
-	md, ok := metadata.FromContext(ctx)
+	md, ok := metadata.FromIncomingContext(ctx)
 	if !ok || md == nil {
 		return grpc.Errorf(codes.PermissionDenied, "MD not found")
 	}