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
46fbc88e
Commit
46fbc88e
authored
Sep 24, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent HTTPS to HTTP redirect
parent
eb0ff130
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
src/transports/http.c
+6
-1
No files found.
src/transports/http.c
View file @
46fbc88e
...
...
@@ -287,6 +287,11 @@ static int set_connection_data_from_url(
if
(
!
git__prefixcmp
(
url
,
prefix_http
))
{
url
=
url
+
strlen
(
prefix_http
);
default_port
=
"80"
;
if
(
t
->
use_ssl
)
{
giterr_set
(
GITERR_NET
,
"Redirect from HTTPS to HTTP not allowed"
);
return
-
1
;
}
}
if
(
!
git__prefixcmp
(
url
,
prefix_https
))
{
...
...
@@ -324,7 +329,7 @@ static int set_connection_data_from_url(
/* Allow '/'-led urls, or a change of protocol */
if
(
original_host
!=
NULL
)
{
if
(
strcmp
(
original_host
,
t
->
host
)
&&
t
->
location
[
0
]
!=
'/'
)
{
giterr_set
(
GITERR_NET
,
"
Only same-host redirects are support
ed"
);
giterr_set
(
GITERR_NET
,
"
Cross host redirect not allow
ed"
);
error
=
-
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