Skip to content

Commit 1883267

Browse files
Add User-Agent header
1 parent a48614b commit 1883267

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

mailtrap/client.py

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ def headers(self) -> Dict[str, str]:
4343
return {
4444
"Authorization": f"Bearer {self.token}",
4545
"Content-Type": "application/json",
46+
"User-Agent": (
47+
"mailtrap-python (https://github.com/railsware/mailtrap-python)"
48+
),
4649
}
4750

4851
@staticmethod

tests/unit/test_client.py

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ def test_headers_should_return_appropriate_dict(self) -> None:
4141
assert client.headers == {
4242
"Authorization": "Bearer fake_token",
4343
"Content-Type": "application/json",
44+
"User-Agent": (
45+
"mailtrap-python (https://github.com/railsware/mailtrap-python)"
46+
),
4447
}
4548

4649
@responses.activate

0 commit comments

Comments
 (0)