Skip to content

Commit e9b232a

Browse files
committed
requests with User-Agent ci in ci env
1 parent 451cf4e commit e9b232a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bioimageio/spec/shared/_resolve_source.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,11 @@ def _download_url(uri: raw_nodes.URI, output: typing.Optional[os.PathLike] = Non
466466
# download with tqdm adapted from:
467467
# https://github.com/shaypal5/tqdl/blob/189f7fd07f265d29af796bee28e0893e1396d237/tqdl/core.py
468468
# Streaming, so we can iterate over the response.
469-
r = requests.get(str(uri), stream=True)
469+
headers = {}
470+
if os.environ.get("CI", "false").lower() in ("1", "t", "true", "yes", "y"):
471+
headers["User-Agent"] = "ci"
472+
473+
r = requests.get(str(uri), stream=True, headers=headers)
470474
r.raise_for_status()
471475
# Total size in bytes.
472476
total_size = int(r.headers.get("content-length", 0))

0 commit comments

Comments
 (0)