forked from GithubBackups/healthchecks
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.
This commit is contained in:
parent
37817fe9b0
commit
35e9c17f74
@ -139,7 +139,8 @@ class Channel(models.Model):
|
|||||||
n.save()
|
n.save()
|
||||||
elif self.kind == "webhook" and check.status == "down":
|
elif self.kind == "webhook" and check.status == "down":
|
||||||
try:
|
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
|
n.status = r.status_code
|
||||||
except requests.exceptions.Timeout:
|
except requests.exceptions.Timeout:
|
||||||
# Well, we tried
|
# Well, we tried
|
||||||
|
Loading…
x
Reference in New Issue
Block a user