Skip to content

Commit c669b6c

Browse files
Update firebase_admin/_http_client.py
gemini-code-assist Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent c2a8d4b commit c669b6c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

firebase_admin/_http_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,11 @@ class call this method to send HTTP requests out. Refer to
161161
Raises:
162162
RequestException: Any requests exceptions encountered while making the HTTP call.
163163
"""
164+
if self._session is None:
165+
raise RuntimeError('HTTP client has been closed.')
164166
if 'timeout' not in kwargs:
165167
kwargs['timeout'] = self.timeout
166168
kwargs.setdefault('headers', {}).update(METRICS_HEADERS)
167-
# possible issue: AttributeError <- _session can be None
168169
resp = self._session.request(method, self.base_url + url, **kwargs)
169170
resp.raise_for_status()
170171
return resp

0 commit comments

Comments
 (0)