Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
c78c7ee6
Commit
c78c7ee6
authored
May 12, 2021
by
Tyler Ang-Wanek
Committed by
Edward Thomson
Jun 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
httpclient: no proxy creds in requests if proxy is CONNECT type
parent
28328570
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
src/transports/httpclient.c
+8
-3
No files found.
src/transports/httpclient.c
View file @
c78c7ee6
...
@@ -658,6 +658,11 @@ static int generate_connect_request(
...
@@ -658,6 +658,11 @@ static int generate_connect_request(
return
git_buf_oom
(
buf
)
?
-
1
:
0
;
return
git_buf_oom
(
buf
)
?
-
1
:
0
;
}
}
static
bool
use_connect_proxy
(
git_http_client
*
client
)
{
return
client
->
proxy
.
url
.
host
&&
!
strcmp
(
client
->
server
.
url
.
scheme
,
"https"
);
}
static
int
generate_request
(
static
int
generate_request
(
git_http_client
*
client
,
git_http_client
*
client
,
git_http_request
*
request
)
git_http_request
*
request
)
...
@@ -713,7 +718,8 @@ static int generate_request(
...
@@ -713,7 +718,8 @@ static int generate_request(
git_buf_printf
(
buf
,
"Expect: 100-continue
\r\n
"
);
git_buf_printf
(
buf
,
"Expect: 100-continue
\r\n
"
);
if
((
error
=
apply_server_credentials
(
buf
,
client
,
request
))
<
0
||
if
((
error
=
apply_server_credentials
(
buf
,
client
,
request
))
<
0
||
(
error
=
apply_proxy_credentials
(
buf
,
client
,
request
))
<
0
)
(
!
use_connect_proxy
(
client
)
&&
(
error
=
apply_proxy_credentials
(
buf
,
client
,
request
))
<
0
))
return
error
;
return
error
;
if
(
request
->
custom_headers
)
{
if
(
request
->
custom_headers
)
{
...
@@ -1003,8 +1009,7 @@ static int http_client_connect(
...
@@ -1003,8 +1009,7 @@ static int http_client_connect(
reset_parser
(
client
);
reset_parser
(
client
);
/* Reconnect to the proxy if necessary. */
/* Reconnect to the proxy if necessary. */
use_proxy
=
client
->
proxy
.
url
.
host
&&
use_proxy
=
use_connect_proxy
(
client
);
!
strcmp
(
client
->
server
.
url
.
scheme
,
"https"
);
if
(
use_proxy
)
{
if
(
use_proxy
)
{
if
(
!
client
->
proxy_connected
||
!
client
->
keepalive
||
if
(
!
client
->
proxy_connected
||
!
client
->
keepalive
||
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment