1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-05 15:57:23 +01:00

Add QA tests for TOTP

This commit is contained in:
downtownallday
2020-09-10 15:24:47 -04:00
parent 24ae913d68
commit 5852a7aabb
6 changed files with 350 additions and 20 deletions

View File

@@ -59,7 +59,15 @@ rest_urlencoded() {
if $onlydata; then
data+=("--data-urlencode" "$item");
else
data+=("$item")
# if argument is like "--header=<val>", then change to
# "--header <val>" because curl wants the latter
local arg="$(awk -F= '{print $1}' <<<"$item")"
local val="$(awk -F= '{print substr($0,length($1)+2)}' <<<"$item")"
if [ -z "$val" ]; then
data+=("$item")
else
data+=("$arg" "$val")
fi
fi
;;
* )