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 7, 2024
1 parent 5bb1b71 commit 8829d9c
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 @@ -75,7 +75,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 8829d9c

Please sign in to comment.