summaryrefslogtreecommitdiffstats
path: root/src/WebAdmin.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-02 20:02:52 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-02 20:02:52 +0200
commit017235e15ccdfca901d63793c5544626e730ec48 (patch)
tree7a7e09cebb06bf042ae7e8506ab8384e123d12b6 /src/WebAdmin.h
parentMerge branch 'master' into WebAdmin (diff)
downloadcuberite-017235e15ccdfca901d63793c5544626e730ec48.tar
cuberite-017235e15ccdfca901d63793c5544626e730ec48.tar.gz
cuberite-017235e15ccdfca901d63793c5544626e730ec48.tar.bz2
cuberite-017235e15ccdfca901d63793c5544626e730ec48.tar.lz
cuberite-017235e15ccdfca901d63793c5544626e730ec48.tar.xz
cuberite-017235e15ccdfca901d63793c5544626e730ec48.tar.zst
cuberite-017235e15ccdfca901d63793c5544626e730ec48.zip
Diffstat (limited to 'src/WebAdmin.h')
-rw-r--r--src/WebAdmin.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/WebAdmin.h b/src/WebAdmin.h
index a59c69096..d6baa2ef9 100644
--- a/src/WebAdmin.h
+++ b/src/WebAdmin.h
@@ -116,7 +116,7 @@ public:
/** Stops the HTTP server, if it was started. */
void Stop(void);
- /** Loads the login template. Returns true if the loading success, false if not. */
+ /** Loads the login template. Returns true if the loading succeeds, false if not. */
bool LoadLoginTemplate(void);
void AddPlugin(cWebPlugin * a_Plugin);
@@ -149,6 +149,9 @@ public:
/** Returns the prefix needed for making a link point to the webadmin root from the given URL ("../../../webadmin"-style) */
static AString GetBaseURL(const AStringVector & a_URLSplit);
+ /** Returns the content type from the file extension. If the extension isn't in the list, the function returns "text/html" */
+ AString GetContentTypeFromFileExt(const AString & a_FileExtension);
+
protected:
/** Common base class for request body data handlers */
class cRequestData
@@ -208,7 +211,7 @@ protected:
/** The Lua template script to provide templates: */
cLuaState m_TemplateScript;
- /** The template who provide the login side: */
+ /** The template that provides the login site: */
AString m_LoginTemplate;
/** The HTTP server which provides the underlying HTTP parsing, serialization and events */
@@ -220,6 +223,9 @@ protected:
/** Handles requests for the root page */
void HandleRootRequest(cHTTPConnection & a_Connection, cHTTPRequest & a_Request);
+ /** Handles requests for a file */
+ void HandleFileRequest(cHTTPConnection & a_Connection, cHTTPRequest & a_Request);
+
// cHTTPServer::cCallbacks overrides:
virtual void OnRequestBegun (cHTTPConnection & a_Connection, cHTTPRequest & a_Request) override;
virtual void OnRequestBody (cHTTPConnection & a_Connection, cHTTPRequest & a_Request, const char * a_Data, size_t a_Size) override;