Skip to content

Commit 5e60ddc

Browse files
committed
Add pass-through args for sessions
1 parent 1107f68 commit 5e60ddc

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pori_python/graphkb/util.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def __init__(
9999
password: str = '',
100100
use_global_cache: bool = True,
101101
cache_name: str = '',
102+
**session_kwargs
102103
):
103104
"""
104105
Docstring for __init__
@@ -114,16 +115,18 @@ def __init__(
114115
cache_control=True,
115116
allowable_methods=['GET', 'POST'],
116117
ignored_parameters=['Authorization'],
118+
**session_kwargs
117119
)
118120
else:
119121
self.http = CustomSession(
120122
cache_name,
121123
cache_control=True,
122124
allowable_methods=['GET', 'POST'],
123125
ignored_parameters=['Authorization'],
126+
**session_kwargs
124127
)
125128
else:
126-
self.http = requests.Session()
129+
self.http = requests.Session(**session_kwargs)
127130
retries = Retry(
128131
total=100,
129132
connect=5,

0 commit comments

Comments
 (0)