Skip to content

Commit 08d5725

Browse files
committed
client: Use the default URL is we get a falsy value
Before this change, passing None would not do what you'd expect. With this change, we get the expected default URL.
1 parent f1b3cf6 commit 08d5725

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

leakix/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@ class HostResult(Model):
2525
Leaks: fields.Optional(fields.List(fields.Nested(l9format.L9Event)))
2626

2727

28+
DEFAULT_URL = "https://leakix.net"
2829
class Client:
2930
MAX_RESULTS_PER_PAGE = 20
3031

3132
def __init__(
3233
self,
3334
api_key: Optional[str] = None,
34-
base_url: Optional[str] = "https://leakix.net",
35+
base_url: Optional[str] = DEFAULT_URL,
3536
):
3637
self.api_key = api_key
37-
self.base_url = base_url
38+
self.base_url = base_url if base_url else DEFAULT_URL
3839
self.headers = {
3940
"Accept": "application/json",
4041
"User-agent": "leakix-client-python/%s" % __VERSION__,

0 commit comments

Comments
 (0)