From 33a4977a83edf072f7be51c87649bdfdc5455268 Mon Sep 17 00:00:00 2001 From: Hamza Ali Shahjahan <191920295+hamza-ali-shahjahan@users.noreply.github.com> Date: Fri, 26 Jun 2026 05:28:51 +0500 Subject: [PATCH] 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. --- benchmarks/benchmark-local.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/benchmarks/benchmark-local.py b/benchmarks/benchmark-local.py index f1a57de..8ffe58a 100644 --- a/benchmarks/benchmark-local.py +++ b/benchmarks/benchmark-local.py @@ -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)