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

Hardcoded defaultcontenttype

This commit is contained in:
niansa 2020-08-04 19:44:49 +02:00
parent ba19b2d8b6
commit 3a1d6062c9
4 changed files with 3 additions and 10 deletions

View file

@ -9,9 +9,6 @@ FILES="/var/www/html/"
# The finished Document will saved here. ${OUTFILEID} must be included!
OUTFILE="/tmp/simpsh-html.${OUTFILEID}.html"
# This Content-Type send the Server, if the requested File isn't a folder or phpfile
DEFAULTCONTENTTYPE="text/html"
# This port will used for listening
PORT=8888

View file

@ -2,9 +2,7 @@ struct databuffer SUUSER;
struct databuffer FILES;
struct databuffer HTMLTITLE;
struct databuffer OUTFILE;
struct databuffer DEFAULTCONTENTTYPE;
uint PORT;
struct databuffer WEBSITE;
bool ENABLE_PHP;
bool ENABLE_MARKDOWN;
struct databuffer ERROR404;
@ -19,9 +17,6 @@ void config() {
// Here is the webroot (homefolder for the website)
FILES = auto_db("/var/www/html/");
// This Content-Type send the Server, if the requested File isn't a folder or phpfile
DEFAULTCONTENTTYPE = auto_db("text/html");
// This port will used for listening
PORT = 8888;

View file

@ -19,7 +19,8 @@ void urlcheck() {
//db_append(&status, &WEBSITE);
db_append(&status, &url);
db_append(&status, &thisdb);
db_set(&contenttype, &DEFAULTCONTENTTYPE);
thisdb = auto_db("text/html");
db_set(&contenttype, &thisdb);
httpheaders();
done = true;
}

View file

@ -11,7 +11,7 @@ if [ -d "$FILE" ]; then
if [[ "$URL" != */ ]]; then
STATUS='HTTP/1.0 302 Moved permanently
Location: '"$URL"'/'
CONTENTTYPE="$DEFAULTCONTENTTYPE"
CONTENTTYPE="text/html"
. ./httpheaders.sh
DONE=true
fi