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
35969c68
Commit
35969c68
authored
Sep 10, 2015
by
Matt Burke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore NULL headers
parent
c49126c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
src/transports/http.c
+2
-1
src/transports/winhttp.c
+12
-10
No files found.
src/transports/http.c
View file @
35969c68
...
...
@@ -213,7 +213,8 @@ static int gen_request(
if
(
t
->
owner
->
custom_headers
)
{
for
(
i
=
0
;
i
<
t
->
owner
->
custom_headers
->
count
;
i
++
)
{
git_buf_printf
(
buf
,
"%s
\r\n
"
,
t
->
owner
->
custom_headers
->
strings
[
i
]);
if
(
t
->
owner
->
custom_headers
->
strings
[
i
])
git_buf_printf
(
buf
,
"%s
\r\n
"
,
t
->
owner
->
custom_headers
->
strings
[
i
]);
}
}
...
...
src/transports/winhttp.c
View file @
35969c68
...
...
@@ -412,17 +412,19 @@ static int winhttp_stream_connect(winhttp_stream *s)
if
(
t
->
owner
->
custom_headers
)
{
for
(
i
=
0
;
i
<
t
->
owner
->
custom_headers
->
count
;
i
++
)
{
git_buf_clear
(
&
buf
);
git_buf_puts
(
&
buf
,
t
->
owner
->
custom_headers
->
strings
[
i
]);
if
(
git__utf8_to_16
(
ct
,
MAX_CONTENT_TYPE_LEN
,
git_buf_cstr
(
&
buf
))
<
0
)
{
giterr_set
(
GITERR_OS
,
"Failed to convert custom header to wide characters"
);
goto
on_error
;
}
if
(
t
->
owner
->
custom_headers
->
strings
[
i
])
{
git_buf_clear
(
&
buf
);
git_buf_puts
(
&
buf
,
t
->
owner
->
custom_headers
->
strings
[
i
]);
if
(
git__utf8_to_16
(
ct
,
MAX_CONTENT_TYPE_LEN
,
git_buf_cstr
(
&
buf
))
<
0
)
{
giterr_set
(
GITERR_OS
,
"Failed to convert custom header to wide characters"
);
goto
on_error
;
}
if
(
!
WinHttpAddRequestHeaders
(
s
->
request
,
ct
,
(
ULONG
)
-
1L
,
WINHTTP_ADDREQ_FLAG_ADD
|
WINHTTP_ADDREQ_FLAG_REPLACE
))
{
giterr_set
(
GITERR_OS
,
"Failed to add a header to the request"
);
goto
on_error
;
if
(
!
WinHttpAddRequestHeaders
(
s
->
request
,
ct
,
(
ULONG
)
-
1L
,
WINHTTP_ADDREQ_FLAG_ADD
|
WINHTTP_ADDREQ_FLAG_REPLACE
))
{
giterr_set
(
GITERR_OS
,
"Failed to add a header to the request"
);
goto
on_error
;
}
}
}
}
...
...
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