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.
This commit is contained in:
Carlos Martín Nieto 2015-09-23 04:39:05 +02:00
parent 2f3f1ee085
commit 22e6aa0d4f
2 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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) {