diff --git a/src/falconpy/_util.py b/src/falconpy/_util.py index b991683ba..acba4d064 100644 --- a/src/falconpy/_util.py +++ b/src/falconpy/_util.py @@ -407,16 +407,14 @@ def confirm_base_url(provided_base: str = "https://api.crowdstrike.com"): If it does not, it is looked up in the BaseURL enum. If the value is not found within the enum, https:// is prepended to the value and then it is used for API requests. """ - returned_base = "https://api.crowdstrike.com" + # Assume they passed a full URL + returned_base = provided_base if "://" not in provided_base: # They're passing the name instead of the URL try: returned_base = f"https://{BaseURL[provided_base.upper()].value}" except KeyError: - # Invalid base URL name, assume they didn't give us https + # Invalid base URL name, fall back to assuming they didn't give us https returned_base = f"https://{provided_base}" - else: - # They passed a full URL - returned_base = provided_base return returned_base