summaryrefslogtreecommitdiffstats
path: root/source/HTTPServer/HTTPMessage.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-04 20:28:30 +0200
committermadmaxoft <github@xoft.cz>2013-10-04 20:28:30 +0200
commitdb3d83b38dd61b90466a0721fa9104e742f3fb8b (patch)
treeba45a5a87eb7a688cbbe05587abaf1bea667371f /source/HTTPServer/HTTPMessage.h
parentHTTP Server can now parse multipart/form-data forms; better architecture. (diff)
downloadcuberite-db3d83b38dd61b90466a0721fa9104e742f3fb8b.tar
cuberite-db3d83b38dd61b90466a0721fa9104e742f3fb8b.tar.gz
cuberite-db3d83b38dd61b90466a0721fa9104e742f3fb8b.tar.bz2
cuberite-db3d83b38dd61b90466a0721fa9104e742f3fb8b.tar.lz
cuberite-db3d83b38dd61b90466a0721fa9104e742f3fb8b.tar.xz
cuberite-db3d83b38dd61b90466a0721fa9104e742f3fb8b.tar.zst
cuberite-db3d83b38dd61b90466a0721fa9104e742f3fb8b.zip
Diffstat (limited to 'source/HTTPServer/HTTPMessage.h')
-rw-r--r--source/HTTPServer/HTTPMessage.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/HTTPServer/HTTPMessage.h b/source/HTTPServer/HTTPMessage.h
index ef8e12ca4..151eb468f 100644
--- a/source/HTTPServer/HTTPMessage.h
+++ b/source/HTTPServer/HTTPMessage.h
@@ -91,6 +91,15 @@ public:
/// Returns true if more data is expected for the request headers
bool IsInHeaders(void) const { return m_EnvelopeParser.IsInHeaders(); }
+ /// Returns true if the request did present auth data that was understood by the parser
+ bool HasAuth(void) const { return m_HasAuth; }
+
+ /// Returns the username that the request presented. Only valid if HasAuth() is true
+ const AString & GetAuthUsername(void) const { return m_AuthUsername; }
+
+ /// Returns the password that the request presented. Only valid if HasAuth() is true
+ const AString & GetAuthPassword(void) const { return m_AuthPassword; }
+
protected:
/// Parser for the envelope data
cEnvelopeParser m_EnvelopeParser;
@@ -110,6 +119,15 @@ protected:
/// Data that the HTTPServer callbacks are allowed to store.
void * m_UserData;
+ /// Set to true if the request contains auth data that was understood by the parser
+ bool m_HasAuth;
+
+ /// The username used for auth
+ AString m_AuthUsername;
+
+ /// The password used for auth
+ AString m_AuthPassword;
+
/** Parses the incoming data for the first line (RequestLine)
Returns the number of bytes consumed, or -1 for an error