diff --git a/src/data_collection/knmi_sources.py b/src/data_collection/knmi_sources.py index f6e88c9a..f962ef9b 100644 --- a/src/data_collection/knmi_sources.py +++ b/src/data_collection/knmi_sources.py @@ -36,7 +36,7 @@ class KnmiSourceMixin: headers = {"Authorization": api_key} getter = getattr(self, "_http_get", None) if callable(getter): - resp = getter(url) + resp = getter(url, headers=headers) return resp.content if hasattr(resp, "content") else resp resp = self.session.get(url, timeout=self.timeout, headers=headers) resp.raise_for_status() @@ -46,7 +46,7 @@ class KnmiSourceMixin: headers = {"Authorization": api_key} getter = getattr(self, "_http_get_json", None) if callable(getter): - return getter(url) + return getter(url, headers=headers) resp = self.session.get(url, timeout=self.timeout, headers=headers) resp.raise_for_status() return resp.json()