mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-05 16:03:47 +00:00
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:
committed by
GitHub
co-authored by
Alexander Petric
parent
4502d66fd3
commit
28562a2bad
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user