File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 77
88from geocoder .base import OneResult , MultipleResultsQuery
99from geocoder .location import Location
10-
10+ from geocoder . keys import ipinfo_key
1111
1212class IpinfoResult (OneResult ):
1313
@@ -74,8 +74,17 @@ class IpinfoQuery(MultipleResultsQuery):
7474
7575 _URL = 'http://ipinfo.io/json'
7676 _RESULT_CLASS = IpinfoResult
77+ _KEY = ipinfo_key
7778 _KEY_MANDATORY = False
7879
80+ def _build_headers (self , provider_key , ** kwargs ):
81+ return {
82+ 'Authorization' : 'Bearer {}' .format (provider_key ),
83+ }
84+
85+ def _build_params (self , location , provider_key , ** kwargs ):
86+ return {}
87+
7988 def _before_initialize (self , location , ** kwargs ):
8089 if location .lower () == 'me' or location == '' :
8190 self .url = 'http://ipinfo.io/json'
Original file line number Diff line number Diff line change 2525geocodefarm_key = os .environ .get ('GEOCODEFARM_API_KEY' )
2626tgos_key = os .environ .get ('TGOS_API_KEY' )
2727locationiq_key = os .environ .get ('LOCATIONIQ_API_KEY' )
28-
28+ ipinfo_key = os . environ . get ( 'IPINFO_API_KEY' )
2929
3030class CanadapostKeyLazySingleton (object ):
3131
You can’t perform that action at this time.
0 commit comments