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
c3733e56
Commit
c3733e56
authored
Sep 04, 2015
by
Matt Burke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more headers to HTTP requests
parent
1cef6b9f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
src/transports/http.c
+9
-0
No files found.
src/transports/http.c
View file @
c3733e56
...
...
@@ -54,6 +54,7 @@ typedef struct {
char
*
redirect_url
;
const
char
*
verb
;
char
*
chunk_buffer
;
git_strarray
*
extra_headers
;
unsigned
chunk_buffer_len
;
unsigned
sent_request
:
1
,
received_response
:
1
,
...
...
@@ -193,6 +194,7 @@ static int gen_request(
{
http_subtransport
*
t
=
OWNING_SUBTRANSPORT
(
s
);
const
char
*
path
=
t
->
connection_data
.
path
?
t
->
connection_data
.
path
:
"/"
;
size_t
i
;
git_buf_printf
(
buf
,
"%s %s%s HTTP/1.1
\r\n
"
,
s
->
verb
,
path
,
s
->
service_url
);
...
...
@@ -210,6 +212,13 @@ static int gen_request(
}
else
git_buf_puts
(
buf
,
"Accept: */*
\r\n
"
);
if
(
s
->
extra_headers
)
{
for
(
i
=
0
;
i
<
s
->
extra_headers
->
count
;
i
++
)
{
git_buf_puts
(
buf
,
s
->
extra_headers
->
strings
[
i
]);
git_buf_puts
(
buf
,
"
\r\n
"
);
}
}
/* Apply credentials to the request */
if
(
apply_credentials
(
buf
,
t
)
<
0
)
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