* cfg[unbuffered] now does additional fun things
parent
b1710af38b
commit
19d97773a9
|
@ -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"
|
${cfg[extra_headers]}\r\n"
|
||||||
|
else
|
||||||
|
echo "uh oh - we're running unbuffered" > /dev/stderr
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ${r[status]} == 200 ]]; then
|
if [[ ${r[status]} == 200 ]]; then
|
||||||
get_mime "${r[uri]}"
|
get_mime "${r[uri]}"
|
||||||
|
@ -8,7 +12,6 @@ fi
|
||||||
|
|
||||||
if [[ ${r[status]} == 212 ]]; then
|
if [[ ${r[status]} == 212 ]]; then
|
||||||
if [[ "${cfg[unbuffered]}" == true ]]; then
|
if [[ "${cfg[unbuffered]}" == true ]]; then
|
||||||
printf "\r\n"
|
|
||||||
source "${r[view]}"
|
source "${r[view]}"
|
||||||
else
|
else
|
||||||
temp=$(mktemp)
|
temp=$(mktemp)
|
||||||
|
|
|
@ -160,6 +160,7 @@ fi
|
||||||
|
|
||||||
echo "${r[url]}" >&2
|
echo "${r[url]}" >&2
|
||||||
|
|
||||||
|
|
||||||
if [[ "${cfg[auth_required]}" == true && "${r[authorized]}" != true ]]; then
|
if [[ "${cfg[auth_required]}" == true && "${r[authorized]}" != true ]]; then
|
||||||
echo "Auth failed." >> ${cfg[log_misc]}
|
echo "Auth failed." >> ${cfg[log_misc]}
|
||||||
r[status]=401
|
r[status]=401
|
||||||
|
@ -212,6 +213,9 @@ if [[ "${r[post]}" == true && "${r[status]}" == 200 ]]; then
|
||||||
fi
|
fi
|
||||||
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
|
if [[ ${r[status]} == 210 && ${cfg[autoindex]} == true ]]; then
|
||||||
source "src/response/listing.sh"
|
source "src/response/listing.sh"
|
||||||
elif [[ ${r[status]} == 211 ]]; then
|
elif [[ ${r[status]} == 211 ]]; then
|
||||||
|
|
Loading…
Reference in New Issue