diff Core/HttpServer/MongooseServer.cpp @ 1592:d73124f6b439

configuration option HttpDescribeErrors
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Aug 2015 11:35:16 +0200
parents bd1889029cbb
children 939b921b2c81
line wrap: on
line diff
--- a/Core/HttpServer/MongooseServer.cpp	Thu Aug 27 10:54:52 2015 +0200
+++ b/Core/HttpServer/MongooseServer.cpp	Thu Aug 27 11:35:16 2015 +0200
@@ -583,6 +583,7 @@
 
     MongooseOutputStream stream(connection);
     HttpOutput output(stream, that->IsKeepAliveEnabled());
+    output.SetDescribeErrorsEnabled(that->IsDescribeErrorsEnabled());
 
     // Check remote calls
     if (!that->IsRemoteAccessAllowed() &&
@@ -831,6 +832,7 @@
     filter_ = NULL;
     keepAlive_ = false;
     httpCompression_ = true;
+    describeErrors_ = true;
 
 #if ORTHANC_SSL_ENABLED == 1
     // Check for the Heartbleed exploit
@@ -980,6 +982,12 @@
     httpCompression_ = enabled;
     LOG(WARNING) << "HTTP compression is " << (enabled ? "enabled" : "disabled");
   }
+  
+  void MongooseServer::SetDescribeErrorsEnabled(bool enabled)
+  {
+    describeErrors_ = enabled;
+    LOG(INFO) << "Description of the errors in the HTTP answers is " << (enabled ? "enabled" : "disabled");
+  }
 
   void MongooseServer::SetIncomingHttpRequestFilter(IIncomingHttpRequestFilter& filter)
   {