]> git.ipfire.org Git - thirdparty/git.git/commit
http: reject unsupported proxy URL schemes
authorAliwoto <aminnimaj@gmail.com>
Tue, 5 May 2026 09:19:40 +0000 (09:19 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 May 2026 23:40:44 +0000 (08:40 +0900)
commit663d7abe07ea376c2657019a03297ae87037c993
treeff12a3de11d1fa5759f94cd89d5f8237b2b2c2f2
parent94f057755b7941b321fd11fec1b2e3ca5313a4e0
http: reject unsupported proxy URL schemes

An explicit proxy URL with an unrecognized scheme such as
htpp://127.0.0.1 is currently accepted.

Git parses the URL, extracts the host part, and then passes only that
host to libcurl. Because no proxy type is selected for the unknown
scheme, Git leaves libcurl at its default HTTP proxy type, so the typo
is silently treated as an HTTP proxy.

Reject proxy URLs with explicit unsupported schemes instead of silently
accepting them. Keep the existing host:port-without-scheme behavior
unchanged.

Implement the SOCKS proxy handling with a shared table-driven mapping.

Add a regression test to cover the unsupported-scheme case.

Signed-off-by: Aliwoto <aminnimaj@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c
t/t5564-http-proxy.sh