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) --- takahe/settings.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'takahe') diff --git a/takahe/settings.py b/takahe/settings.py index 981bb96..f508952 100644 --- a/takahe/settings.py +++ b/takahe/settings.py @@ -7,6 +7,7 @@ from typing import Literal import dj_database_url import django_cache_url +import httpx import sentry_sdk from pydantic import AnyUrl, BaseSettings, EmailStr, Field, validator from sentry_sdk.integrations.django import DjangoIntegration @@ -354,3 +355,8 @@ CACHES = {"default": django_cache_url.parse(SETUP.CACHES_DEFAULT or "dummy://")} if SETUP.ERROR_EMAILS: ADMINS = [("Admin", e) for e in SETUP.ERROR_EMAILS] + +TAKAHE_USER_AGENT = ( + f"python-httpx/{httpx.__version__} " + f"(Takahe/{__version__}; +https://{SETUP.MAIN_DOMAIN}/)" +) -- cgit v1.2.3