outgoing_http: Provide a convenient way to set default headers.

This commit is contained in:
Alex Vandiver
2021-05-06 16:57:46 -07:00
committed by Tim Abbott
parent 6339e7fd47
commit 8df82f50e4
3 changed files with 25 additions and 7 deletions

View File

@@ -36,11 +36,7 @@ class OutgoingWebhookServiceInterface(metaclass=abc.ABCMeta):
self.session: requests.Session = OutgoingSession(
role="webhook",
timeout=10,
)
self.session.headers.update(
{
"User-Agent": "ZulipOutgoingWebhook/" + ZULIP_VERSION,
}
headers={"User-Agent": "ZulipOutgoingWebhook/" + ZULIP_VERSION},
)
@abc.abstractmethod