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
33f93bf3
Unverified
Commit
33f93bf3
authored
Jan 06, 2020
by
Patrick Steinhardt
Committed by
GitHub
Jan 06, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5325 from josharian/no-double-slash
http: avoid generating double slashes in url
parents
f5173597
05c1fb8a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
src/transports/http.c
+6
-2
src/transports/winhttp.c
+5
-1
No files found.
src/transports/http.c
View file @
33f93bf3
...
...
@@ -183,7 +183,11 @@ static int gen_request(
{
http_subtransport
*
t
=
OWNING_SUBTRANSPORT
(
s
);
const
char
*
path
=
t
->
server
.
url
.
path
?
t
->
server
.
url
.
path
:
"/"
;
const
char
*
service_url
=
s
->
service_url
;
size_t
i
;
/* If path already ends in /, remove the leading slash from service_url */
if
((
git__suffixcmp
(
path
,
"/"
)
==
0
)
&&
(
git__prefixcmp
(
service_url
,
"/"
)
==
0
))
service_url
++
;
if
(
t
->
proxy_opts
.
type
==
GIT_PROXY_SPECIFIED
)
git_buf_printf
(
buf
,
"%s %s://%s:%s%s%s HTTP/1.1
\r\n
"
,
...
...
@@ -191,10 +195,10 @@ static int gen_request(
t
->
server
.
url
.
scheme
,
t
->
server
.
url
.
host
,
t
->
server
.
url
.
port
,
path
,
s
->
s
ervice_url
);
path
,
service_url
);
else
git_buf_printf
(
buf
,
"%s %s%s HTTP/1.1
\r\n
"
,
s
->
verb
,
path
,
s
->
s
ervice_url
);
s
->
verb
,
path
,
service_url
);
git_buf_puts
(
buf
,
"User-Agent: "
);
git_http__user_agent
(
buf
);
...
...
src/transports/winhttp.c
View file @
33f93bf3
...
...
@@ -373,11 +373,15 @@ static int winhttp_stream_connect(winhttp_stream *s)
int
default_connect_timeout
=
DEFAULT_CONNECT_TIMEOUT
;
DWORD
autologon_policy
=
WINHTTP_AUTOLOGON_SECURITY_LEVEL_HIGH
;
const
char
*
service_url
=
s
->
service_url
;
size_t
i
;
const
git_proxy_options
*
proxy_opts
;
/* If path already ends in /, remove the leading slash from service_url */
if
((
git__suffixcmp
(
t
->
server
.
url
.
path
,
"/"
)
==
0
)
&&
(
git__prefixcmp
(
service_url
,
"/"
)
==
0
))
service_url
++
;
/* Prepare URL */
git_buf_printf
(
&
buf
,
"%s%s"
,
t
->
server
.
url
.
path
,
s
->
s
ervice_url
);
git_buf_printf
(
&
buf
,
"%s%s"
,
t
->
server
.
url
.
path
,
service_url
);
if
(
git_buf_oom
(
&
buf
))
return
-
1
;
...
...
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