mirror of
https://framagit.org/framasoft/framaspace/argos.git
synced 2025-04-28 18:02:41 +02:00
💄 — Use a custom User-Agent header
This commit is contained in:
parent
269e551502
commit
2c5420cc9d
2 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
- 💄 — Use a custom User-Agent header
|
||||||
|
|
||||||
## 0.4.0
|
## 0.4.0
|
||||||
|
|
||||||
Date: 2024-09-04
|
Date: 2024-09-04
|
||||||
|
|
|
@ -11,6 +11,7 @@ from typing import List
|
||||||
import httpx
|
import httpx
|
||||||
from tenacity import retry, wait_random # type: ignore
|
from tenacity import retry, wait_random # type: ignore
|
||||||
|
|
||||||
|
from argos import VERSION
|
||||||
from argos.checks import get_registered_check
|
from argos.checks import get_registered_check
|
||||||
from argos.logging import logger
|
from argos.logging import logger
|
||||||
from argos.schemas import AgentResult, SerializableException, Task
|
from argos.schemas import AgentResult, SerializableException, Task
|
||||||
|
@ -47,6 +48,7 @@ class ArgosAgent:
|
||||||
async def run(self):
|
async def run(self):
|
||||||
headers = {
|
headers = {
|
||||||
"Authorization": f"Bearer {self.auth}",
|
"Authorization": f"Bearer {self.auth}",
|
||||||
|
"User-Agent": f"Argos Panoptes {VERSION} (about: https://argos-monitoring.framasoft.org/)",
|
||||||
}
|
}
|
||||||
self._http_client = httpx.AsyncClient(headers=headers)
|
self._http_client = httpx.AsyncClient(headers=headers)
|
||||||
logger.info("Running agent against %s", self.server)
|
logger.info("Running agent against %s", self.server)
|
||||||
|
|
Loading…
Reference in a new issue