Skip to content

Commit 455ec9b

Browse files
committed
set the user agent to be astroquery, always!
1 parent 615fc10 commit 455ec9b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

astroquery/query.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ class BaseQuery(object):
9797

9898
def __init__(self):
9999
self._session = requests.session()
100+
self._session.headers['User-Agent'] = ('astropy:astroquery.{vers} '
101+
'{olduseragent}'
102+
.format(vers=version.version,
103+
olduseragent=
104+
self._session.headers['User-Agent']))
100105
self.cache_location = os.path.join(paths.get_cache_dir(), 'astroquery',
101106
self.__class__.__name__.split("Class")[0])
102107
if not os.path.exists(self.cache_location):

0 commit comments

Comments
 (0)