diff --git a/zulip/__init__.py b/zulip/__init__.py index 6aa118f..bacfcf1 100644 --- a/zulip/__init__.py +++ b/zulip/__init__.py @@ -213,7 +213,9 @@ class Client(object): self.email = email self.verbose = verbose if site is not None: - if not site.startswith("http"): + if site.startswith("localhost"): + site = "http://" + site + elif not site.startswith("http"): site = "https://" + site # Remove trailing "/"s from site to simplify the below logic for adding "/api" site = site.rstrip("/")