From e26dc591ccbb143ad7d9537efc5cee1f87791615 Mon Sep 17 00:00:00 2001 From: Bram Daams Date: Thu, 2 Apr 2020 23:00:28 +0200 Subject: [PATCH 1/2] added name and version in user agent string when talking to the hc api --- sch/sch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sch/sch.py b/sch/sch.py index 360a772..458a154 100644 --- a/sch/sch.py +++ b/sch/sch.py @@ -19,6 +19,7 @@ import requests import tzlocal from crontabs import CronTabs from ttictoc import TicToc +from . import __version__ HANDLER = logging.handlers.SysLogHandler('/dev/log') FORMATTER = logging.Formatter( @@ -221,7 +222,10 @@ class Healthchecks: """ def __init__(self, cred): self.cred = cred - self.auth_headers = {'X-Api-Key': self.cred.api_key} + self.auth_headers = { + 'X-Api-Key': self.cred.api_key, + 'User-Agent': 'sch/{version}'.format(version=__version__) + } def get_checks(self, query=''): """Returns a list of checks from the HC API""" -- GitLab From 92b522eb52938e2760a6b16b0b1212d3edd938a6 Mon Sep 17 00:00:00 2001 From: Bram Daams Date: Thu, 2 Apr 2020 23:01:35 +0200 Subject: [PATCH 2/2] changelog --- HISTORY.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index cbee5e0..09f16dd 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -13,5 +13,6 @@ - previous released packages where broken... ### release notes for 0.2.4 -- updated release notes +- setting the user-agent string to 'sch/{version}' when interacting with the + Healthchecks API - got rid of outdated development section in the readme -- GitLab