* fix in header handling

merge-requests/2/head
Dominika Liberda 2021-05-17 17:12:25 +02:00
parent 9ea79c084b
commit ad7ce7d222
1 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ if [[ ${r[status]} == 212 ]]; then
else
temp=$(mktemp)
source "${r[view]}" > $temp
[[ "${r[headers]}" != '' ]] && printf "${r[headers]}\r\n\r\n" || printf "\r\n"
[[ "${r[headers]}" != '' ]] && printf "${r[headers]}\r\n" || printf "\r\n"
cat $temp
rm $temp
fi
@ -24,21 +24,21 @@ if [[ ${r[status]} == 212 ]]; then
elif [[ "${cfg[php_enabled]}" == true && "${r[uri]}" =~ ".php" ]]; then
temp=$(mktemp)
php "${r[uri]}" "$(get_dump)" "$(post_dump)" > $temp
[[ "${r[headers]}" != '' ]] && printf "${r[headers]}\r\n\r\n" || printf "\r\n"
[[ "${r[headers]}" != '' ]] && printf "${r[headers]}\r\n" || printf "\r\n"
cat $temp
rm $temp
elif [[ "${cfg[python_enabled]}" == true && "${r[uri]}" =~ ".py" ]]; then
temp=$(mktemp)
python "${r[uri]}" "$(get_dump)" "$(post_dump)" > $temp
[[ "${r[headers]}" != '' ]] && printf "${r[headers]}\r\n\r\n" || printf "\r\n"
[[ "${r[headers]}" != '' ]] && printf "${r[headers]}\r\n" || printf "\r\n"
cat $temp
rm $temp
elif [[ "${r[uri]}" =~ \.${cfg[extension]}$ ]]; then
temp=$(mktemp)
source "${r[uri]}" > $temp
[[ "${r[headers]}" != '' ]] && printf "${r[headers]}\r\n\r\n" || printf "\r\n"
[[ "${r[headers]}" != '' ]] && printf "${r[headers]}\r\n" || printf "\r\n"
if [[ "${cfg[encoding]}" != '' ]]; then
iconv $temp -f UTF-8 -t "${cfg[encoding]}"
else