Skip to content

Commit

Permalink
Pass API key as header value and no longer as query parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
lpellegr committed Jun 13, 2024
1 parent ca53a7e commit 148b67a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ipregistry/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def origin_lookup_ip(self, options):
pass

def _build_base_url(self, ip, options):
result = self._config.base_url + "/" + ip + "?key=" + self._config.api_key
result = self._config.base_url + "/" + ip

for key, value in options.items():
if isinstance(value, bool):
Expand Down Expand Up @@ -135,9 +135,9 @@ def __create_api_error(response):
else:
raise ClientError("HTTP Error occurred, but no response was received.")

@staticmethod
def __headers():
def __headers(self):
return {
"authorization": "ApiKey " + self._config.api_key,
"content-type": "application/json",
"user-agent": "Ipregistry/Python" + str(sys.version_info[0]) + "/" + __version__
}

0 comments on commit 148b67a

Please sign in to comment.