1
0
Fork 0
mirror of https://gitlab.com/niansa/simpsh-httpd.git synced 2025-03-06 20:53:36 +01:00

Set CONTENTTYPE in sendfile.sh just once

This commit is contained in:
niansa 2020-08-03 16:43:29 +02:00
parent 3b4e1e6701
commit cb40468346

View file

@ -1,13 +1,13 @@
#! /bin/bash
# TODO: Create a Plugin system
CONTENTTYPE="text/html"
# Check: Is it a Directory, a PHP script or something else?
if [[ "$FILE" == *.php ]] && [ "$(which php)" != "" ] && [ "$ENABLE_PHP" = "true" ]; then
CONTENTTYPE="text/html"
. ./httpheaders.sh
php "$FILE" >> $OUTFILE
elif [[ "$FILE" == *.md ]] && [ "$(which pandoc)" != "" ] && [ "$ENABLE_MARKDOWN" = "true" ]; then
CONTENTTYPE="text/html"
. ./httpheaders.sh
pandoc -f markdown_github "$FILE" >> $OUTFILE
elif [ -f "${FILE}" ]; then
@ -15,7 +15,6 @@ elif [ -f "${FILE}" ]; then
. ./httpheaders.sh
cat "${FILE}" >> ${OUTFILE}
else
CONTENTTYPE="text/html"
. ./httpheaders.sh
. ./filelist.sh
fi