Skip to content

Commit

Permalink
Configure a custom user agent for API requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
neprune committed Aug 21, 2024
1 parent f0290c0 commit f68feb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cobrand_hackney/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
session = requests.Session()
else: # pragma: no cover
session = CachedSession(expire_after=86400)
session.headers.update({"Authorization": api["key"]})
session.headers.update({"Authorization": api["key"], "User-Agent": api["user_agent"]})


def construct_address(address, include_postcode=False):
Expand Down
1 change: 1 addition & 0 deletions noiseworks/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@
"url": env.str("ADDRESS_API_URL", "https://example.com/"),
"pageAttr": env.str("ADDRESS_API_PAGEATTR", "page_count"),
"key": env.str("ADDRESS_API_KEY", "key"),
"user_agent": env.str("USER_AGENT", "noiseworks"),
},
"data_export": {
"ACCESS_KEY_ID": env.str("EXPORT_KEY", None),
Expand Down

0 comments on commit f68feb2

Please sign in to comment.