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:
parent
ba19b2d8b6
commit
3a1d6062c9
4 changed files with 3 additions and 10 deletions
|
@ -9,9 +9,6 @@ FILES="/var/www/html/"
|
||||||
# The finished Document will saved here. ${OUTFILEID} must be included!
|
# The finished Document will saved here. ${OUTFILEID} must be included!
|
||||||
OUTFILE="/tmp/simpsh-html.${OUTFILEID}.html"
|
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
|
# This port will used for listening
|
||||||
PORT=8888
|
PORT=8888
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,7 @@ struct databuffer SUUSER;
|
||||||
struct databuffer FILES;
|
struct databuffer FILES;
|
||||||
struct databuffer HTMLTITLE;
|
struct databuffer HTMLTITLE;
|
||||||
struct databuffer OUTFILE;
|
struct databuffer OUTFILE;
|
||||||
struct databuffer DEFAULTCONTENTTYPE;
|
|
||||||
uint PORT;
|
uint PORT;
|
||||||
struct databuffer WEBSITE;
|
|
||||||
bool ENABLE_PHP;
|
bool ENABLE_PHP;
|
||||||
bool ENABLE_MARKDOWN;
|
bool ENABLE_MARKDOWN;
|
||||||
struct databuffer ERROR404;
|
struct databuffer ERROR404;
|
||||||
|
@ -19,9 +17,6 @@ void config() {
|
||||||
// Here is the webroot (homefolder for the website)
|
// Here is the webroot (homefolder for the website)
|
||||||
FILES = auto_db("/var/www/html/");
|
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
|
// This port will used for listening
|
||||||
PORT = 8888;
|
PORT = 8888;
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,8 @@ void urlcheck() {
|
||||||
//db_append(&status, &WEBSITE);
|
//db_append(&status, &WEBSITE);
|
||||||
db_append(&status, &url);
|
db_append(&status, &url);
|
||||||
db_append(&status, &thisdb);
|
db_append(&status, &thisdb);
|
||||||
db_set(&contenttype, &DEFAULTCONTENTTYPE);
|
thisdb = auto_db("text/html");
|
||||||
|
db_set(&contenttype, &thisdb);
|
||||||
httpheaders();
|
httpheaders();
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ if [ -d "$FILE" ]; then
|
||||||
if [[ "$URL" != */ ]]; then
|
if [[ "$URL" != */ ]]; then
|
||||||
STATUS='HTTP/1.0 302 Moved permanently
|
STATUS='HTTP/1.0 302 Moved permanently
|
||||||
Location: '"$URL"'/'
|
Location: '"$URL"'/'
|
||||||
CONTENTTYPE="$DEFAULTCONTENTTYPE"
|
CONTENTTYPE="text/html"
|
||||||
. ./httpheaders.sh
|
. ./httpheaders.sh
|
||||||
DONE=true
|
DONE=true
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue