Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion hchk/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
VERSION = pkg_resources.get_distribution("hchk").version
UA = "hchk/%s" % VERSION
USE_SSL = True
API_ENDPOINT = os.environ.get("HEALTHCHECKS_API_ENDPOINT", "https://healthchecks.io/api/v1/checks/")
if sys.version_info[0:3] < (2, 7, 9):
# Certificate validation is a mess on Python < 2.7.9
USE_SSL = False
Expand All @@ -38,7 +39,7 @@ def create_check(self, check):
if check.get("grace"):
payload["grace"] = int(check["grace"])

url = "https://healthchecks.io/api/v1/checks/"
url = API_ENDPOINT
data = json.dumps(payload)
r = requests.post(url, data=data, headers={"User-Agent": UA},
verify=USE_SSL)
Expand Down