fix(benchmark): reject --ollama-url without a host (#315)
Follow-up to #274: the merged scheme validation accepts host-less URLs (http://, https://), which then fail opaquely inside urlopen(). Add a minimal netloc check after the existing scheme check, so a missing host is rejected up front with a clear argparse error. Additive; keeps the existing scheme message intact.
This commit is contained in:
@@ -154,6 +154,8 @@ def main():
|
||||
parsed_url = urllib.parse.urlparse(args.ollama_url)
|
||||
if parsed_url.scheme not in ("http", "https"):
|
||||
parser.error(f"Invalid --ollama-url scheme: '{parsed_url.scheme}'. Only 'http' and 'https' are supported.")
|
||||
if not parsed_url.netloc:
|
||||
parser.error(f"--ollama-url must include a host, e.g. http://localhost:11434 (got '{args.ollama_url}').")
|
||||
|
||||
run(args.model, args.repeat, args.ollama_url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user