From 35e9c17f74493c12d637a5d97f908808ea2d0668 Mon Sep 17 00:00:00 2001 From: Love Sharma Date: Fri, 22 Jan 2016 13:57:20 +0800 Subject: [PATCH] Add healthcheck UA to inform server about identity Adding "healthcheck.io" as User-Agent to inform webhook handler server about request is specific from healthcheck. --- hc/api/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hc/api/models.py b/hc/api/models.py index 34673d68..46a524af 100644 --- a/hc/api/models.py +++ b/hc/api/models.py @@ -139,7 +139,8 @@ class Channel(models.Model): n.save() elif self.kind == "webhook" and check.status == "down": try: - r = requests.get(self.value, timeout=5) + headers = {"User-Agent": "healthchecks.io"} + r = requests.get(self.value, timeout=5, headers=headers) n.status = r.status_code except requests.exceptions.Timeout: # Well, we tried