[PATCH v2 0/1] http: reject unsupported proxy URL schemes
- From
aminnimaj@gmail.com <aminnimaj@gmail.com>
- Date
- May 5, 2026, 09:19 UTC
- Message-ID
- <20260505091941.1825-1-aminnimaj@gmail.com>
- In-Reply-To
- <20260501190401.1580-1-aminnimaj@gmail.com>
From: Aliwoto <aminnimaj@gmail.com>
An explicit proxy URL with an unsupported scheme such as htpp://127.0.0.1 is currently accepted and treated as an HTTP proxy.
This happens because Git parses the URL, extracts the host part, and passes only that host to libcurl without rejecting the unsupported scheme. As a result, the typo is silently accepted.
This patch rejects explicit unsupported proxy schemes while keeping the existing host:port-without-scheme behavior unchanged, and adds a regression test for the unsupported-scheme case.
--- Changes in v2: - make SOCKS proxy type handling table-driven - use test_must_fail in the regression test - use test_grep on the essential error text
Aliwoto (1): http: reject unsupported proxy URL schemes
http.c | 93 +++++++++++++++++++++++++++++++------------ t/t5564-http-proxy.sh | 6 +++ 2 files changed, 74 insertions(+), 25 deletions(-)
base-commit: 67ad42147a7acc2af6074753ebd03d904476118f
-- 2.49.0.windows.1