Skip to content

Commit

Permalink
weird behavior for non 200s
Browse files Browse the repository at this point in the history
  • Loading branch information
cgsdev0 committed Aug 26, 2023
1 parent 219a0cb commit ecf5ac5
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit ecf5ac5

Please sign in to comment.