* cfg[unbuffered] now does additional fun things

merge-requests/2/head
Dominika Liberda 2021-05-03 21:12:02 +00:00
parent b1710af38b
commit 19d97773a9
2 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,9 @@
printf "HTTP/1.0 200 OK
if [[ "${cfg[unbuffered]}" != true ]]; then
printf "HTTP/1.0 200 OK
${cfg[extra_headers]}\r\n"
else
echo "uh oh - we're running unbuffered" > /dev/stderr
fi
if [[ ${r[status]} == 200 ]]; then
get_mime "${r[uri]}"
@ -8,7 +12,6 @@ fi
if [[ ${r[status]} == 212 ]]; then
if [[ "${cfg[unbuffered]}" == true ]]; then
printf "\r\n"
source "${r[view]}"
else
temp=$(mktemp)

View File

@ -160,6 +160,7 @@ fi
echo "${r[url]}" >&2
if [[ "${cfg[auth_required]}" == true && "${r[authorized]}" != true ]]; then
echo "Auth failed." >> ${cfg[log_misc]}
r[status]=401
@ -212,6 +213,9 @@ if [[ "${r[post]}" == true && "${r[status]}" == 200 ]]; then
fi
fi
# the app config gets loaded a second time to allow for path-specific config modification
[[ -f "${cfg[namespace]}/config.sh" ]] && source "${cfg[namespace]}/config.sh"
if [[ ${r[status]} == 210 && ${cfg[autoindex]} == true ]]; then
source "src/response/listing.sh"
elif [[ ${r[status]} == 211 ]]; then