From ecf5ac55629f7ec10d25a458f5ddf628f3c8998c Mon Sep 17 00:00:00 2001 From: Sarah Schulte Date: Sat, 26 Aug 2023 04:03:39 -0700 Subject: [PATCH] weird behavior for non 200s --- core.sh | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/core.sh b/core.sh index 662a5bb..6597068 100755 --- a/core.sh +++ b/core.sh @@ -479,18 +479,9 @@ writeHttpResponse() { fi result=$(source "pages/${ROUTE_SCRIPT}") CODE=$? - if [[ "$CODE" -lt 64 ]]; then - # for i in "${!HTTP_HEADERS[@]}"; do - # debug "%s=%s" "$i" "${HTTP_HEADERS[$i]}" - # done - respond 200 OK - [[ -z $CUSTOM_HEADERS ]] && header Content-Type "text/html" && end_headers - printf "%s" "$result" - else - respond $(decode_result $CODE) - end_headers - printf "%s" "$result" - fi + respond $(decode_result $CODE) + [[ -z $CUSTOM_HEADERS ]] && header Content-Type "text/html" && end_headers + printf "%s" "$result" } findRoutes() {