summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMichael Manfre2022-12-06 23:59:05 -0500
committerGitHub2022-12-06 21:59:05 -0700
commit39a40e4dae8da8b6e7072fcbee2fc745c27c016d (patch)
treeb8f149b4d232cd4f5598535ded61cfb7dd121e78 /core
parent126c7a14ecc89936ea5477d7baf1eb200da71f53 (diff)
downloadtakahe-39a40e4dae8da8b6e7072fcbee2fc745c27c016d.tar.gz
takahe-39a40e4dae8da8b6e7072fcbee2fc745c27c016d.tar.bz2
takahe-39a40e4dae8da8b6e7072fcbee2fc745c27c016d.zip
Set a Takahe User-Agent header for signed requests (#142)
Diffstat (limited to 'core')
-rw-r--r--core/signatures.py4
1 files changed, 4 insertions, 0 deletions
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: