Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
6c17b21f
Commit
6c17b21f
authored
Apr 02, 2026
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: add redirect depth limit to url_get_raw_real_url
parent
6bd6a9fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
tools_eget
bin/tools_eget
+7
-0
No files found.
bin/tools_eget
View file @
6c17b21f
...
...
@@ -2031,8 +2031,15 @@ url_get_raw_real_url()
[
-
n
"
$MADEURL
"
]
&&
[
"
$MADEURL
"
=
"
$URL
"
]
&&
echo
"
$URL
"
&&
return
local
loc
base
=
"
$URL
"
local
redirect_count
=
0
local
max_redirects
=
10
# follow redirect chain in order, updating base URL at each step
for
loc
in
$(
url_get_header
"
$URL
"
"Location"
|
sed
-e
's| .*||'
)
;
do
redirect_count
=
$((
$redirect_count
+
1
))
if
[
"
$redirect_count
"
-
gt
"
$max_redirects
"
]
;
then
echo
"Warning: too many redirects (>
$max_redirects
) for
$URL
"
>&
2
break
fi
# add protocol if missed
if
is_protocol_relative_url
"
$loc
"
;
then
loc
=
"
$(
echo
"
$base
"
|
sed
-e
's|//.*||'
)
$loc
"
...
...
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