💄 — Use a custom User-Agent header

This commit is contained in:
Luc Didry 2024-09-05 16:18:14 +02:00
parent 269e551502
commit 2c5420cc9d
No known key found for this signature in database
GPG key ID: EA868E12D0257E3C
2 changed files with 4 additions and 0 deletions

View file

@ -2,6 +2,8 @@
## [Unreleased]
- 💄 — Use a custom User-Agent header
## 0.4.0
Date: 2024-09-04

View file

@ -11,6 +11,7 @@ from typing import List
import httpx
from tenacity import retry, wait_random # type: ignore
from argos import VERSION
from argos.checks import get_registered_check
from argos.logging import logger
from argos.schemas import AgentResult, SerializableException, Task
@ -47,6 +48,7 @@ class ArgosAgent:
async def run(self):
headers = {
"Authorization": f"Bearer {self.auth}",
"User-Agent": f"Argos Panoptes {VERSION} (about: https://argos-monitoring.framasoft.org/)",
}
self._http_client = httpx.AsyncClient(headers=headers)
logger.info("Running agent against %s", self.server)