Skip to content

Commit

Permalink
Merge pull request #249 from OnroerendErfgoed/develop
Browse files Browse the repository at this point in the history
Fixes #248
  • Loading branch information
claeyswo committed Apr 2, 2024
2 parents 91c1222 + a5ef1ca commit caed079
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 2,978 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.3.2 (02-04-2024)
------------------

- Set x-api-key on all requests (#248)

1.3.1 (23-11-2023)
------------------

Expand Down
6 changes: 5 additions & 1 deletion crabpy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ def _get_list(self, url, response_key, params=None):

def _get(self, url, params=None):
try:
response = self.session.get(f"{self.base_url}{url}", params=params)
response = self.session.get(
f"{self.base_url}{url}",
params=params,
headers=self.v2_header if "v2" in url else self.v1_header,
)
response.raise_for_status()
return response.json()
except RequestException as e:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="crabpy",
version="1.3.1",
version="1.3.2",
description="Interact with geographical webservices by Informatie Vlaanderen.",
long_description=open("README.rst").read() + "\n\n" + open("CHANGES.rst").read(),
author="Onroerend Erfgoed",
Expand Down
2 changes: 1 addition & 1 deletion tests/gateway/test_adressenregister.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def test_list_straten(self, gateway, client):
)
assert len(res) == 2
assert res[0].id == "1"
assert res[0].naam == "Acacialaan"
assert res[0].naam() == "Acacialaan"
assert res[0].status == "inGebruik"

def test_get_straat_by_id(self, gateway, client):
Expand Down

0 comments on commit caed079

Please sign in to comment.