Skip to content

Commit 8e7508c

Browse files
author
Steve Kirkland
committed
Only default endpoints if not already set
1 parent bffdb66 commit 8e7508c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bugsnag/configuration.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,13 +592,16 @@ def _create_null_logger(self) -> logging.Logger:
592592
return logger
593593

594594
def _initialize_endpoints(self, endpoint, session_endpoint, api_key):
595-
if endpoint is None and session_endpoint is None:
595+
# Default endpoints depending on the API key, if not already set
596+
if (endpoint is None and session_endpoint is None and
597+
self.endpoint is None and self.session_endpoint is None):
596598
if _is_hub_api_key(api_key):
597599
self.endpoint = HUB_ENDPOINT
598600
self.session_endpoint = HUB_SESSIONS_ENDPOINT
599601
else:
600602
self.endpoint = DEFAULT_ENDPOINT
601603
self.session_endpoint = DEFAULT_SESSIONS_ENDPOINT
604+
# Do set endpoints if explicitly provided
602605
if endpoint is not None:
603606
self.endpoint = endpoint
604607
if session_endpoint is not None:

0 commit comments

Comments
 (0)