Skip to content

Commit 7a528af

Browse files
committed
Include backend name in requests user-agent string
1 parent 3e3c97d commit 7a528af

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

anymail/backends/base_requests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ def open(self):
3535
if not self.fail_silently:
3636
raise
3737
else:
38-
self.session.headers["User-Agent"] = "Anymail/%s %s" % (
39-
__version__, self.session.headers.get("User-Agent", ""))
38+
self.session.headers["User-Agent"] = "django-anymail/{version}-{esp} {orig}".format(
39+
esp=self.esp_name.lower(), version=__version__,
40+
orig=self.session.headers.get("User-Agent", ""))
4041
return True
4142

4243
def close(self):

0 commit comments

Comments
 (0)