* fix router parameter clobbering

if a route contained a static string with the same name as one
of the named params, said string would overwrite the payload from
the previous named param. this commit adds a check for `:` in the
template to prevent this
This commit is contained in:
sdomi 2024-04-21 21:54:06 +02:00
parent a94d7b7c24
commit 231b52f171

View file

@ -133,7 +133,7 @@ if [[ ${r[status]} != 101 ]]; then
url_=(${r[url]})
unset IFS
for (( j=0; j<${#url[@]}; j++ )); do
if [[ ${url_[$j]} != '' ]]; then
if [[ ${url_[$j]} != '' && ${url[$j]} == ":"* ]]; then
params[$(sed 's/://' <<< "${url[$j]}")]="${url_[$j]}"
fi
done