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
b59344bf
Commit
b59344bf
authored
Sep 26, 2013
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tighten up url-connection utility
parent
256961e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
src/netops.c
+2
-8
No files found.
src/netops.c
View file @
b59344bf
...
@@ -584,15 +584,13 @@ int gitno_connection_data_from_url(
...
@@ -584,15 +584,13 @@ int gitno_connection_data_from_url(
int
error
=
-
1
;
int
error
=
-
1
;
const
char
*
default_port
=
NULL
;
const
char
*
default_port
=
NULL
;
char
*
original_host
=
NULL
;
char
*
original_host
=
NULL
;
bool
original_use_ssl
;
/* service_suffix is optional */
/* service_suffix is optional */
assert
(
data
&&
url
);
assert
(
data
&&
url
);
/* Save these for comparison later */
/* Save these for comparison later */
if
(
data
->
host
)
original_host
=
data
->
host
;
original_host
=
git__strdup
(
data
->
host
);
data
->
host
=
NULL
;
original_use_ssl
=
data
->
use_ssl
;
gitno_connection_data_free_ptrs
(
data
);
gitno_connection_data_free_ptrs
(
data
);
if
(
!
git__prefixcmp
(
url
,
prefix_http
))
{
if
(
!
git__prefixcmp
(
url
,
prefix_http
))
{
...
@@ -632,10 +630,6 @@ int gitno_connection_data_from_url(
...
@@ -632,10 +630,6 @@ int gitno_connection_data_from_url(
data
->
path
=
git__strdup
(
path
);
data
->
path
=
git__strdup
(
path
);
/* Check for errors in the resulting data */
/* Check for errors in the resulting data */
if
(
original_use_ssl
&&
!
data
->
use_ssl
)
{
giterr_set
(
GITERR_NET
,
"Redirect from HTTPS to HTTP not allowed"
);
error
=
-
1
;
}
if
(
original_host
&&
url
[
0
]
!=
'/'
&&
strcmp
(
original_host
,
data
->
host
))
{
if
(
original_host
&&
url
[
0
]
!=
'/'
&&
strcmp
(
original_host
,
data
->
host
))
{
giterr_set
(
GITERR_NET
,
"Cross host redirect not allowed"
);
giterr_set
(
GITERR_NET
,
"Cross host redirect not allowed"
);
error
=
-
1
;
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