File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ class ConfigDict(typing.TypedDict):
7474 master_node (typing.Union[str, NodeConfigDict], deprecated): A dictionary or
7575 URL that represents the master node.
7676
77+ additional_headers (dict): Additional headers to include in the request.
78+
7779 read_replica_nodes (list[typing.Union[str, NodeConfigDict]], deprecated): A list of
7880 dictionaries or URLs that represent the read replica nodes.
7981 """
@@ -87,6 +89,7 @@ class ConfigDict(typing.TypedDict):
8789 verify : typing .NotRequired [bool ]
8890 timeout_seconds : typing .NotRequired [int ] # deprecated
8991 master_node : typing .NotRequired [typing .Union [str , NodeConfigDict ]] # deprecated
92+ additional_headers : typing .NotRequired [typing .Dict [str , str ]]
9093 read_replica_nodes : typing .NotRequired [
9194 typing .List [typing .Union [str , NodeConfigDict ]]
9295 ] # deprecated
@@ -213,6 +216,7 @@ def __init__(
213216 60 ,
214217 )
215218 self .verify = config_dict .get ("verify" , True )
219+ self .additional_headers = config_dict .get ("additional_headers" , {})
216220
217221 def _handle_nearest_node (
218222 self ,
Original file line number Diff line number Diff line change @@ -204,7 +204,11 @@ def make_request(
204204 Raises:
205205 TypesenseClientError: If the API returns an error response.
206206 """
207- headers = {self .api_key_header_name : self .config .api_key }
207+ headers = {
208+ self .api_key_header_name : self .config .api_key ,
209+ }
210+ headers .update (self .config .additional_headers )
211+
208212 kwargs .setdefault ("headers" , {}).update (headers )
209213 kwargs .setdefault ("timeout" , self .config .connection_timeout_seconds )
210214 kwargs .setdefault ("verify" , self .config .verify )
You can’t perform that action at this time.
0 commit comments