Skip to content

Commit

Permalink
http: header: add default User-Agent header
Browse files Browse the repository at this point in the history
As customary with API libraries, it is useful for server operators to
know which library makes requests to it. This sets the default to the
library + version.

Signed-off-by: Frank Villaro-Dixon <[email protected]>
  • Loading branch information
Frankkkkk committed May 6, 2024
1 parent 5fcc3b8 commit ba6a61d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion overpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ class Overpass:
#: Default URL of the Overpass server
default_url: ClassVar[str] = "http://overpass-api.de/api/interpreter"

default_headers: ClassVar[Dict[str, str]] = {}
default_headers: ClassVar[Dict[str, str]] = {
'User-Agent': 'python-overpy/{} (urllib)'.format(__version__),
}

def __init__(
self,
Expand Down

0 comments on commit ba6a61d

Please sign in to comment.