diff --git a/HTTPServer.cpp b/HTTPServer.cpp index 0834b4d2..3ced372b 100644 --- a/HTTPServer.cpp +++ b/HTTPServer.cpp @@ -457,6 +457,10 @@ namespace util "//8AAAAH/////wAAAA//////gAAAH//////AAAA//////+AAAH//////+AAA///////+AAP///////+" "AH//////////////8="; + const char HTTP_COMMAND_TUNNELS[] = "tunnels"; + const char HTTP_COMMAND_TRANSIT_TUNNELS[] = "transit_tunnels"; + const char HTTP_COMMAND_TRANSPORTS[] = "transports"; + namespace misc_strings { @@ -539,7 +543,7 @@ namespace util void HTTPConnection::RunRequest () { auto address = ExtractAddress (); - if (address.length () > 1) // not just '/' + if (address.length () > 1 && address[1] != '?') // not just '/' or '/?' { std::string uri ("/"), b32; size_t pos = address.find ('/', 1); @@ -554,7 +558,7 @@ namespace util HandleDestinationRequest (b32, uri); } else - HandleRequest (); + HandleRequest (address); } std::string HTTPConnection::ExtractAddress () @@ -582,7 +586,7 @@ namespace util AsyncStreamReceive (); } - void HTTPConnection::HandleRequest () + void HTTPConnection::HandleRequest (const std::string& address) { std::stringstream s; // Html5 head start @@ -590,9 +594,12 @@ namespace util s << "
"; // TODO: Find something to parse html/template system. This is horrible. s << "