File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
bioimageio/spec/_internal Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ def _validate_url(url: Union[str, pydantic.HttpUrl]) -> pydantic.HttpUrl:
1717 return _validate_url_impl (url , request_mode = "head" )
1818
1919
20+ _KNOWN_VALID_URLS = ("https://zenodo.org/records/3446812/files/unet2d_weights.torch" ,)
21+ """known valid urls to bypass validation for to avoid sporadic 503 errors in tests etc."""
22+
23+
2024def _validate_url_impl (
2125 url : Union [str , pydantic .HttpUrl ],
2226 request_mode : Literal ["head" , "get_stream" , "get" ],
@@ -30,7 +34,11 @@ def _validate_url_impl(
3034
3135 val_url = url
3236
33- if url .startswith ("http://example.com" ) or url .startswith ("https://example.com" ):
37+ if (
38+ url .startswith ("http://example.com" )
39+ or url .startswith ("https://example.com" )
40+ or url in _KNOWN_VALID_URLS
41+ ):
3442 return pydantic .HttpUrl (url )
3543
3644 if url .startswith ("https://colab.research.google.com/github/" ):
You can’t perform that action at this time.
0 commit comments