Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eget
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
0
Merge Requests
0
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
eget
Commits
e9561c04
Commit
e9561c04
authored
1 year ago
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eget: check filename in Content-Disposition in case insensivity
parent
b4a39eb5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
eget
eget
+4
-4
No files found.
eget
View file @
e9561c04
...
@@ -1029,15 +1029,15 @@ url_get_filename()
...
@@ -1029,15 +1029,15 @@ url_get_filename()
# See https://www.cpcwood.com/blog/5-aws-s3-utf-8-content-disposition
# See https://www.cpcwood.com/blog/5-aws-s3-utf-8-content-disposition
# https://www.rfc-editor.org/rfc/rfc6266
# https://www.rfc-editor.org/rfc/rfc6266
local cd
=
"
$(
url_get_header
"
$URL
"
"Content-Disposition"
)
"
local cd
=
"
$(
url_get_header
"
$URL
"
"Content-Disposition"
)
"
if
echo
"
$cd
"
|
grep
-qi
"filename
\*
=UTF-8"
;
then
if
echo
"
$cd
"
|
grep
-qi
"filename
\*
=
*
UTF-8"
;
then
#Content-Disposition: attachment; filename="unityhub-amd64-3.3.0.deb"; filename*=UTF-8''"unityhub-amd64-3.3.0.deb"
#Content-Disposition: attachment; filename="unityhub-amd64-3.3.0.deb"; filename*=UTF-8''"unityhub-amd64-3.3.0.deb"
echo
"
$cd
"
|
sed
-e
"s|.*filename
\*
=
UTF-8''||"
-e
"s|.*filename
\*
=utf-8''||
"
-e
's|^"||'
-e
's|";$||'
-e
's|"$||'
echo
"
$cd
"
|
sed
-e
"s|.*filename
\*
=
*UTF-8''||i
"
-e
's|^"||'
-e
's|";$||'
-e
's|"$||'
return
return
fi
fi
if
echo
"
$cd
"
|
grep
-q
"filename="
;
then
if
echo
"
$cd
"
|
grep
-q
i
"filename="
;
then
#Content-Disposition: attachment; filename=postman-linux-x64.tar.gz
#Content-Disposition: attachment; filename=postman-linux-x64.tar.gz
#content-disposition: attachment; filename="code-1.77.1-1680651749.el7.x86_64.rpm"
#content-disposition: attachment; filename="code-1.77.1-1680651749.el7.x86_64.rpm"
echo
"
$cd
"
|
sed
-e
's|.*filename=
||
'
-e
's|^"||'
-e
's|";.*||'
-e
's|"$||'
echo
"
$cd
"
|
sed
-e
's|.*filename=
*||i
'
-e
's|^"||'
-e
's|";.*||'
-e
's|"$||'
return
return
fi
fi
...
...
This diff is collapsed.
Click to expand it.
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