Skip to content

Commit

Permalink
Merge pull request #91 from wimglenn/update-user-agent
Browse files Browse the repository at this point in the history
include email contact in user-agent string, closes #90
  • Loading branch information
wimglenn authored Dec 1, 2022
2 parents d24b4e9 + 9452c46 commit e66f0fe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion aocd/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
AOCD_DATA_DIR = os.path.expanduser(os.environ.get("AOCD_DIR", os.path.join("~", ".config", "aocd")))
AOCD_CONFIG_DIR = os.path.expanduser(os.environ.get("AOCD_CONFIG_DIR", AOCD_DATA_DIR))
URL = "https://adventofcode.com/{year}/day/{day}"
USER_AGENT = {"User-Agent": "advent-of-code-data v{}".format(__version__)}
USER_AGENT = {"User-Agent": "github.com/wimglenn/advent-of-code-data v{} by [email protected]".format(__version__)}


class User(object):
Expand Down
2 changes: 1 addition & 1 deletion aocd/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.2.2"
__version__ = "1.2.3"
2 changes: 1 addition & 1 deletion tests/test_get_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def test_aocd_user_agent_in_req_headers(requests_mock):
aocd.get_data(year=2018, day=1)
assert mock.call_count == 1
headers = mock.last_request._request.headers
expected = "advent-of-code-data v{}".format(aocd.__version__)
expected = "github.com/wimglenn/advent-of-code-data v{} by [email protected]".format(aocd.__version__)
assert headers["User-Agent"] == expected


Expand Down

0 comments on commit e66f0fe

Please sign in to comment.