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
df9fc82e
Commit
df9fc82e
authored
Oct 25, 2013
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use two calls to set two headers
parent
fd5d80d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
src/transports/winhttp.c
+17
-4
No files found.
src/transports/winhttp.c
View file @
df9fc82e
...
...
@@ -269,14 +269,27 @@ static int winhttp_stream_connect(winhttp_stream *s)
/* Send Content-Type and Accept headers -- only necessary on a POST */
git_buf_clear
(
&
buf
);
if
(
git_buf_printf
(
&
buf
,
"Content-Type: application/x-git-%s-request
\r\n
"
"Accept: application/x-git-%s-result
\r\n
"
,
s
->
service
,
s
->
service
)
<
0
)
"Content-Type: application/x-git-%s-request"
,
s
->
service
)
<
0
)
goto
on_error
;
git__utf8_to_16
(
ct
,
MAX_CONTENT_TYPE_LEN
,
git_buf_cstr
(
&
buf
));
if
(
!
WinHttpAddRequestHeaders
(
s
->
request
,
ct
,
(
ULONG
)
-
1L
,
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
;
}
git_buf_clear
(
&
buf
);
if
(
git_buf_printf
(
&
buf
,
"Accept: application/x-git-%s-result"
,
s
->
service
)
<
0
)
goto
on_error
;
git__utf8_to_16
(
ct
,
MAX_CONTENT_TYPE_LEN
,
git_buf_cstr
(
&
buf
));
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