* router parsed after parsing request

merge-requests/2/head
Dominika Liberda 2021-02-26 23:24:19 +01:00
parent 610908cdf2
commit 3218dcfdab
1 changed files with 2 additions and 1 deletions

View File

@ -6,7 +6,6 @@ source src/account.sh
source src/mail.sh
source src/route.sh
[[ -f "${cfg[namespace]}/config.sh" ]] && source "${cfg[namespace]}/config.sh"
[[ -f "${cfg[namespace]}/routes.sh" ]] && source "${cfg[namespace]}/routes.sh"
declare -A r # current request / response
declare -A meta # metadata for templates
@ -115,6 +114,8 @@ fi
echo "$(date) - IP: ${r[ip]}, PROTO: ${r[proto]}, URL: ${r[url]}, GET_data: ${get_data[@]}, POST_data: ${post_data[@]}, POST_multipart: ${post_multipart[@]}" >> "${cfg[namespace]}/${cfg[log]}"
[[ -f "${cfg[namespace]}/routes.sh" ]] && source "${cfg[namespace]}/routes.sh"
if [[ ${r[status]} != 101 ]]; then
for (( i=0; i<${#route[@]}; i=i+3 )); do
if [[ "$(grep -Poh "^${route[$((i+1))]}" <<< "${r[url]}")" != "" ]]; then