mirror of
https://git.sakamoto.pl/laudom/http.sh.git
synced 2026-01-10 19:21:13 +01:00
Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5320a169d |
1 changed files with 13 additions and 2 deletions
15
src/misc.sh
15
src/misc.sh
|
|
@ -111,7 +111,18 @@ _param_parse() {
|
||||||
# http_array(name, out_ref)
|
# http_array(name, out_ref)
|
||||||
http_array() {
|
http_array() {
|
||||||
[[ ! "$1" || ! "$2" ]] && return 1
|
[[ ! "$1" || ! "$2" ]] && return 1
|
||||||
[[ ! "${http_array_refs[$1]}" ]] && return 1
|
if [[ ! "${http_array_refs[$1]}" ]]; then
|
||||||
|
declare -ga $2
|
||||||
|
local -n ref=$2
|
||||||
|
|
||||||
declare -gn $2=${http_array_refs[$1]}
|
if [[ "${post_data[$1]}" ]]; then
|
||||||
|
ref=("${post_data[$1]}")
|
||||||
|
elif [[ "${get_data[$1]}" ]]; then
|
||||||
|
ref=("${get_data[$1]}")
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
declare -gn $2=${http_array_refs[$1]}
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue