fix: set urllib user-agent header in loader.py (cloudflare block) (#6169)

Co-authored-by: Alexander Petric <alex@macbook-pro.lan>
This commit is contained in:
Alexander Petric
2025-07-12 00:36:34 +02:00
committed by GitHub
co-authored by Alexander Petric
parent 4502d66fd3
commit 28562a2bad
+4 -1
View File
@@ -31,7 +31,10 @@ class WindmillFinder(MetaPathFinder):
import urllib.parse
import urllib.request
headers = {"Authorization": f"Bearer {os.environ.get('WM_TOKEN')}"}
headers = {
"Authorization": f"Bearer {os.environ.get('WM_TOKEN')}",
"User-Agent": "windmill/beta"
}
url = f"{os.environ.get('BASE_INTERNAL_URL')}/api/w/{os.environ.get('WM_WORKSPACE')}/scripts/raw/p/{script_path}.py"
req = urllib.request.Request(url, None, headers)