refactor: make --header support in web_get() the same as web_check()
This commit is contained in:
parent
0f69aeae9a
commit
4efd5f7d93
7
quickget
7
quickget
|
@ -1221,6 +1221,7 @@ function web_pipe() {
|
|||
|
||||
# Download a file from the web
|
||||
function web_get() {
|
||||
local HEADERS=()
|
||||
local URL="${1}"
|
||||
local DIR="${2}"
|
||||
local FILE=""
|
||||
|
@ -1235,14 +1236,16 @@ function web_get() {
|
|||
# Process any URL redirections after the file name has been extracted
|
||||
URL=$(web_redirect "${URL}")
|
||||
|
||||
# Process any headers
|
||||
while (( "$#" )); do
|
||||
if [[ $1 == --header ]]; then
|
||||
HEADERS+=("$1" "$2")
|
||||
if [ "${1}" == "--header" ]; then
|
||||
HEADERS+=("${1}" "${2}")
|
||||
shift 2
|
||||
else
|
||||
shift
|
||||
fi
|
||||
done
|
||||
|
||||
# Test mode for ISO
|
||||
if [ "${just}" == 'show' ]; then
|
||||
echo "${URL}"
|
||||
|
|
Loading…
Reference in New Issue