Skip to content

Commit

Permalink
proxy: don't require the trailing slash on WinHTTP
Browse files Browse the repository at this point in the history
The path is not something that you use for proxies, so make use of the
new optionality of the path when extracting URL parts.
  • Loading branch information
carlosmn committed Apr 19, 2016
1 parent 2f3f1ee commit 22e6aa0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion src/transports/winhttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 22e6aa0

Please sign in to comment.