[Libreoffice-commits] online.git: loolwsd/LOOLWSD.cpp

Andras Timar andras.timar at collabora.com
Fri Aug 26 11:40:49 UTC 2016


 loolwsd/LOOLWSD.cpp |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit a5aa138774b028d2f366f24ce3ec8371d7e31e3a
Author: Andras Timar <andras.timar at collabora.com>
Date:   Fri Aug 26 13:40:20 2016 +0200

    loolwsd: response to HTTP GET / (e.g. for checking if server is alive)

diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 828c014..3793624 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -875,6 +875,17 @@ public:
         bool responded = false;
         try
         {
+            if (request.getMethod() == HTTPRequest::HTTP_GET && request.getURI() == "/")
+            {
+                std::string mimeType = "text/plain";
+                std::string responseString = "OK";
+                response.setContentLength(responseString.length());
+                response.setContentType(mimeType);
+                response.setChunkedTransferEncoding(false);
+                std::ostream& ostr = response.send();
+                ostr << responseString;
+                responded = true;
+            }
             if (request.getMethod() == HTTPRequest::HTTP_GET && request.getURI() == "/favicon.ico")
             {
                 std::string mimeType = "image/vnd.microsoft.icon";


More information about the Libreoffice-commits mailing list