Browse Source

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.
pull/36/head
Love Sharma 9 years ago
parent
commit
35e9c17f74
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      hc/api/models.py

+ 2
- 1
hc/api/models.py View File

@ -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


Loading…
Cancel
Save