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
03ac24b1
Unverified
Commit
03ac24b1
authored
Feb 07, 2020
by
Patrick Steinhardt
Committed by
GitHub
Feb 07, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5387 from pks-t/pks/transport-http-custom-headers
transports: http: fix custom headers not being applied
parents
65ac33ae
46228d86
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
src/transports/http.c
+1
-0
tests/online/clone.c
+15
-0
No files found.
src/transports/http.c
View file @
03ac24b1
...
...
@@ -346,6 +346,7 @@ static int generate_request(
request
->
credentials
=
transport
->
server
.
cred
;
request
->
proxy
=
use_proxy
?
&
transport
->
proxy
.
url
:
NULL
;
request
->
proxy_credentials
=
transport
->
proxy
.
cred
;
request
->
custom_headers
=
&
transport
->
owner
->
custom_headers
;
if
(
stream
->
service
->
method
==
GIT_HTTP_METHOD_POST
)
{
request
->
chunked
=
stream
->
service
->
chunked
;
...
...
tests/online/clone.c
View file @
03ac24b1
...
...
@@ -392,6 +392,21 @@ void test_online_clone__credentials(void)
cl_fixture_cleanup
(
"./foo"
);
}
void
test_online_clone__credentials_via_custom_headers
(
void
)
{
const
char
*
creds
=
"libgit3:libgit3"
;
git_buf
auth
=
GIT_BUF_INIT
;
cl_git_pass
(
git_buf_puts
(
&
auth
,
"Authorization: Basic "
));
cl_git_pass
(
git_buf_encode_base64
(
&
auth
,
creds
,
strlen
(
creds
)));
g_options
.
fetch_opts
.
custom_headers
.
count
=
1
;
g_options
.
fetch_opts
.
custom_headers
.
strings
=
&
auth
.
ptr
;
cl_git_pass
(
git_clone
(
&
g_repo
,
"https://bitbucket.org/libgit2/testgitrepository.git"
,
"./foo"
,
&
g_options
));
git_buf_dispose
(
&
auth
);
}
void
test_online_clone__bitbucket_style
(
void
)
{
git_credential_userpass_payload
user_pass
=
{
...
...
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