-
Notifications
You must be signed in to change notification settings - Fork 4
Description
From #137
The change to if schema_url.startswith("http") needs to be carried over. It's necessary to "fix(custom_jsonref_jsonloader): Read from filesystem if schema_url is a file path", because lib-cove has already messed around with the uri value by this point (IIRC), and checking schema_url directly is the only way to know if the URL is a file path or not.
Edit: Indeed - uri is parsed, and then uri is set to uri = urljoin(schema_url, ...). So, if schema_url is a file path, then "http" in uri_info.scheme will be True, even though the subsequent GET request will use a value of uri that's prefixed with a file path (i.e. no scheme). So, it's necessary to check schema_url instead of uri. This is more correct, even if this particular test doesn't need it.