Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
apk-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sertonix
apk-tools
Commits
99e7bb93
Commit
99e7bb93
authored
7 years ago
by
Timo Teräs
Browse files
Options
Downloads
Patches
Plain Diff
libfetch: honor https_proxy variable for https
fixes #8160
parent
b0fcc56f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libfetch/http.c
+30
-11
30 additions, 11 deletions
libfetch/http.c
with
30 additions
and
11 deletions
libfetch/http.c
+
30
−
11
View file @
99e7bb93
...
...
@@ -764,25 +764,44 @@ ouch:
}
static
struct
url
*
http_
get
_proxy
(
struct
url
*
url
,
const
char
*
flags
)
http_
make
_proxy
_url
(
const
char
*
env1
,
const
char
*
env2
)
{
struct
url
*
purl
;
char
*
p
;
p
=
getenv
(
env1
);
if
(
!
p
)
p
=
getenv
(
env2
);
if
(
!
p
||
!*
p
)
return
NULL
;
purl
=
fetchParseURL
(
p
);
if
(
!
purl
)
return
NULL
;
if
(
!*
purl
->
scheme
)
strcpy
(
purl
->
scheme
,
SCHEME_HTTP
);
if
(
!
purl
->
port
)
purl
->
port
=
fetch_default_proxy_port
(
purl
->
scheme
);
if
(
strcasecmp
(
purl
->
scheme
,
SCHEME_HTTP
)
==
0
)
return
purl
;
fetchFreeURL
(
purl
);
return
NULL
;
}
static
struct
url
*
http_get_proxy
(
struct
url
*
url
,
const
char
*
flags
)
{
if
(
flags
!=
NULL
&&
strchr
(
flags
,
'd'
)
!=
NULL
)
return
(
NULL
);
if
(
fetch_no_proxy_match
(
url
->
host
))
return
(
NULL
);
if
(((
p
=
getenv
(
"HTTP_PROXY"
))
||
(
p
=
getenv
(
"http_proxy"
)))
&&
*
p
&&
(
purl
=
fetchParseURL
(
p
)))
{
if
(
!*
purl
->
scheme
)
strcpy
(
purl
->
scheme
,
SCHEME_HTTP
);
if
(
!
purl
->
port
)
purl
->
port
=
fetch_default_proxy_port
(
purl
->
scheme
);
if
(
strcasecmp
(
purl
->
scheme
,
SCHEME_HTTP
)
==
0
)
return
(
purl
);
fetchFreeURL
(
purl
);
}
if
(
strcasecmp
(
url
->
scheme
,
SCHEME_HTTPS
)
==
0
)
return
http_make_proxy_url
(
"HTTPS_PROXY"
,
"https_proxy"
);
if
(
strcasecmp
(
url
->
scheme
,
SCHEME_HTTP
)
==
0
)
return
http_make_proxy_url
(
"HTTP_PROXY"
,
"http_proxy"
);
return
(
NULL
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment