File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ func pskUnaryInterceptor(expectedKey string) grpc.UnaryServerInterceptor {
109109 return nil , status .Error (codes .Unauthenticated , "missing metadata" )
110110 }
111111
112- key := md .Get ("authorization " )
112+ key := md .Get ("x-api-key " )
113113 if len (key ) == 0 || key [0 ] != expectedKey {
114114 return nil , status .Error (codes .Unauthenticated , "invalid API key" )
115115 }
@@ -130,7 +130,7 @@ func pskStreamInterceptor(expectedKey string) grpc.StreamServerInterceptor {
130130 return status .Error (codes .Unauthenticated , "missing metadata" )
131131 }
132132
133- key := md .Get ("authorization " )
133+ key := md .Get ("x-api-key " )
134134 if len (key ) == 0 || key [0 ] != expectedKey {
135135 return status .Error (codes .Unauthenticated , "invalid API key" )
136136 }
Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ fn main() {
194194 let coordinator_client = DriveCoordinatorServiceClient :: with_interceptor (
195195 channel,
196196 move |mut req : tonic:: Request < ( ) > | {
197- req. metadata_mut ( ) . insert ( "authorization " , psk. clone ( ) ) ;
197+ req. metadata_mut ( ) . insert ( "x-api-key " , psk. clone ( ) ) ;
198198 Ok ( req)
199199 } ,
200200 ) ;
You can’t perform that action at this time.
0 commit comments