diff options
author | madmaxoft <github@xoft.cz> | 2013-10-04 20:28:30 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-10-04 20:28:30 +0200 |
commit | db3d83b38dd61b90466a0721fa9104e742f3fb8b (patch) | |
tree | ba45a5a87eb7a688cbbe05587abaf1bea667371f /source/HTTPServer/HTTPMessage.h | |
parent | HTTP Server can now parse multipart/form-data forms; better architecture. (diff) | |
download | cuberite-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 '')
-rw-r--r-- | source/HTTPServer/HTTPMessage.h | 18 |
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 |