Commit 22e6aa0d by Carlos Martín Nieto

proxy: don't require the trailing slash on WinHTTP

The path is not something that you use for proxies, so make use of the
new optionality of the path when extracting URL parts.
parent 2f3f1ee0
......@@ -40,9 +40,9 @@ test_script:
ctest -V -R libgit2_clar-cred_callback
Start-Job { java -jar $Env:APPVEYOR_BUILD_FOLDER\build\poxyproxy.jar -d --port 8080 --credentials foo:bar }
ctest -V .
$env:GITTEST_REMOTE_PROXY_URL = "http://foo:bar@localhost:8080/"
$env:GITTEST_REMOTE_PROXY_URL = "http://foo:bar@localhost:8080"
.\Debug\libgit2_clar.exe -sonline::clone::proxy_credentials_in_url
$env:GITTEST_REMOTE_PROXY_URL = "http://localhost:8080/"
$env:GITTEST_REMOTE_PROXY_URL = "http://localhost:8080"
$env:GITTEST_REMOTE_PROXY_USER = "foo"
$env:GITTEST_REMOTE_PROXY_PASS = "bar"
.\Debug\libgit2_clar.exe -sonline::clone::proxy_credentials_request
......@@ -388,7 +388,8 @@ static int winhttp_stream_connect(winhttp_stream *s)
WINHTTP_PROXY_INFO proxy_info;
wchar_t *proxy_wide;
if ((error = gitno_connection_data_from_url(&t->proxy_connection_data, proxy_url, NULL)) < 0)
if ((error = gitno_extract_url_parts(&t->proxy_connection_data.host, &t->proxy_connection_data.port, NULL,
&t->proxy_connection_data.user, &t->proxy_connection_data.pass, proxy_url, NULL)) < 0)
goto on_error;
if (t->proxy_connection_data.user && t->proxy_connection_data.pass) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment