From 39a40e4dae8da8b6e7072fcbee2fc745c27c016d Mon Sep 17 00:00:00 2001 From: Michael Manfre Date: Tue, 6 Dec 2022 23:59:05 -0500 Subject: Set a Takahe User-Agent header for signed requests (#142) --- core/signatures.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core') diff --git a/core/signatures.py b/core/signatures.py index d0443c3..45e6ff4 100644 --- a/core/signatures.py +++ b/core/signatures.py @@ -220,6 +220,10 @@ class HttpSignature: "algorithm": "rsa-sha256", } ) + + # Announce ourselves with an agent similar to Mastodon + headers["User-Agent"] = settings.TAKAHE_USER_AGENT + # Send the request with all those headers except the pseudo one del headers["(request-target)"] async with httpx.AsyncClient(timeout=timeout) as client: -- cgit v1.2.3