summaryrefslogtreecommitdiffstats
path: root/source/HTTPServer/HTTPServer.cpp
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/HTTPServer.cpp
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/HTTPServer.cpp')
-rw-r--r--source/HTTPServer/HTTPServer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/HTTPServer/HTTPServer.cpp b/source/HTTPServer/HTTPServer.cpp
index 4102d1047..43bb751c4 100644
--- a/source/HTTPServer/HTTPServer.cpp
+++ b/source/HTTPServer/HTTPServer.cpp
@@ -73,6 +73,16 @@ class cDebugCallbacks :
return;
}
+ // Test the auth failure and success:
+ if (a_Request.GetURL() == "/auth")
+ {
+ if (!a_Request.HasAuth() || (a_Request.GetAuthUsername() != "a") || (a_Request.GetAuthPassword() != "b"))
+ {
+ a_Connection.SendNeedAuth("MCServer WebAdmin");
+ return;
+ }
+ }
+
cHTTPResponse Resp;
Resp.SetContentType("text/plain");
a_Connection.Send(Resp);