Apply minor functional improvements

This commit is contained in:
Nick Chambers 2022-01-04 22:44:18 -06:00
parent fba41aeaeb
commit c55ee3965b
1 changed files with 2 additions and 1 deletions

View File

@ -80,13 +80,14 @@ while true; do
fi
elif [[ $line = *": "* ]]; then
hdr_key=${line%%:*} hdr_key=${hdr_key,,}
hdr_val=${line#*: } client_req[hdr-$hdr_key]=$hdr_val
client_req[hdr-$hdr_key]=${line#*: }
elif [[ -z $line ]]; then
req_host=${client_req[hdr-host]-"$HOSTNAME"}
ver=${client_req[version]} code=${client_resp[code]}
if [[ ${client_req[error]} = yes ]]; then
client_req[real-file]=./error.html
client_resp[has-payload]=yes
fi
payload=$(<"${client_req[real-file]}")