From 4a8eeaae5e0f1d7cc59fd4e533dde99316316834 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Mon, 18 May 2026 17:28:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20KNMI=20API=20key=20?= =?UTF-8?q?=E6=9C=AA=E4=BC=A0=E9=80=92=E5=88=B0=20HTTP=20=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E7=9A=84=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/data_collection/knmi_sources.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()