From 06ac6bab32b2a1421928ed8a6f47ecb8108c47ab Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Mon, 18 May 2026 18:19:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20KNMI=20S3=20=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E8=A2=AB=20Auth=20header=20=E6=B1=A1=E6=9F=93?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=20netCDF=20=E8=A7=A3=E6=9E=90=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/data_collection/knmi_sources.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/data_collection/knmi_sources.py b/src/data_collection/knmi_sources.py index f962ef9b..720f4548 100644 --- a/src/data_collection/knmi_sources.py +++ b/src/data_collection/knmi_sources.py @@ -32,13 +32,13 @@ class KnmiSourceMixin: import os return str(os.getenv("KNMI_API_KEY") or "").strip() - def _knmi_http_get(self, url: str, api_key: str) -> bytes: - headers = {"Authorization": api_key} + def _knmi_http_get(self, url: str, api_key: str = "") -> bytes: + """Download file. Does NOT send auth header — download URLs are pre-signed S3 links.""" getter = getattr(self, "_http_get", None) if callable(getter): - resp = getter(url, headers=headers) + resp = getter(url) return resp.content if hasattr(resp, "content") else resp - resp = self.session.get(url, timeout=self.timeout, headers=headers) + resp = self.session.get(url, timeout=self.timeout) resp.raise_for_status() return resp.content