File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -229,7 +229,12 @@ public WeaviateClient(
229229 }
230230
231231 RestClient = new WeaviateRestClient ( Configuration . RestUri , httpClient ) ;
232- GrpcClient = new WeaviateGrpcClient ( Configuration . GrpcUri , wcdHost , _tokenService ) ;
232+ GrpcClient = new WeaviateGrpcClient (
233+ Configuration . GrpcUri ,
234+ wcdHost ,
235+ _tokenService ,
236+ Configuration . Headers
237+ ) ;
233238
234239 Nodes = new NodesClient ( RestClient ) ;
235240 Collections = new CollectionsClient ( this ) ;
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ public WeaviateGrpcClient(
3838 Uri grpcUri ,
3939 string ? wcdHost ,
4040 ITokenService ? tokenService ,
41+ Dictionary < string , string > ? headers = null ,
4142 ILogger < WeaviateGrpcClient > ? logger = null
4243 )
4344 {
@@ -112,6 +113,19 @@ public WeaviateGrpcClient(
112113 {
113114 _defaultHeaders = new Metadata { { "X-Weaviate-Cluster-URL" , wcdHost } } ;
114115 }
116+ if ( headers != null )
117+ {
118+ if ( _defaultHeaders == null )
119+ {
120+ _defaultHeaders = new Metadata ( ) ;
121+ }
122+
123+ foreach ( var header in headers )
124+ {
125+ _defaultHeaders . Add ( header . Key , header . Value ) ;
126+ }
127+ }
128+
115129 _grpcClient = new V1 . Weaviate . WeaviateClient ( _channel ) ;
116130 }
117131
You can’t perform that action at this time.
0 commit comments