File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -136,13 +136,15 @@ class RequestsDispatcher(object):
136136 def __init__ (self , workers = 4 ):
137137 # general session for sync api calls
138138 self .session = RedirectSession ()
139- self .session .headers .update ({'User-Agent' : _get_user_agent ()})
139+ self .session .headers .update ({
140+ 'User-Agent' : _get_user_agent (),
141+ 'X-Planet-App' : 'python-client'
142+ })
140143 # ensure all calls to the session are throttled
141144 self .session .request = _Throttler ().wrap (self .session .request )
142145 # the asyncpool is reserved for long-running async tasks
143- self ._asyncpool = FuturesSession (
144- max_workers = workers ,
145- session = self .session )
146+ self ._asyncpool = FuturesSession (max_workers = workers ,
147+ session = self .session )
146148
147149 def response (self , request ):
148150 return Response (request , self )
Original file line number Diff line number Diff line change 9494
9595def _get_json_or_raise (url , timeout = 11 ):
9696 api_key = find_api_key ()
97- headers = {'User-Agent' : _get_user_agent (),
98- 'Authorization' : 'api-key %s' % api_key }
97+ headers = {
98+ 'User-Agent' : _get_user_agent (),
99+ 'X-Planet-App' : 'python-client' ,
100+ 'Authorization' : 'api-key %s' % api_key
101+ }
99102 resp = requests .get (url , timeout = timeout , headers = headers )
100103 resp .raise_for_status ()
101104 return resp .json ()
You can’t perform that action at this time.
0 commit comments