comparison 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
comparison
equal deleted inserted replaced
1591:cd9d99fe32e9 1592:d73124f6b439
581 { 581 {
582 MongooseServer* that = reinterpret_cast<MongooseServer*>(request->user_data); 582 MongooseServer* that = reinterpret_cast<MongooseServer*>(request->user_data);
583 583
584 MongooseOutputStream stream(connection); 584 MongooseOutputStream stream(connection);
585 HttpOutput output(stream, that->IsKeepAliveEnabled()); 585 HttpOutput output(stream, that->IsKeepAliveEnabled());
586 output.SetDescribeErrorsEnabled(that->IsDescribeErrorsEnabled());
586 587
587 // Check remote calls 588 // Check remote calls
588 if (!that->IsRemoteAccessAllowed() && 589 if (!that->IsRemoteAccessAllowed() &&
589 request->remote_ip != LOCALHOST) 590 request->remote_ip != LOCALHOST)
590 { 591 {
829 ssl_ = false; 830 ssl_ = false;
830 port_ = 8000; 831 port_ = 8000;
831 filter_ = NULL; 832 filter_ = NULL;
832 keepAlive_ = false; 833 keepAlive_ = false;
833 httpCompression_ = true; 834 httpCompression_ = true;
835 describeErrors_ = true;
834 836
835 #if ORTHANC_SSL_ENABLED == 1 837 #if ORTHANC_SSL_ENABLED == 1
836 // Check for the Heartbleed exploit 838 // Check for the Heartbleed exploit
837 // https://en.wikipedia.org/wiki/OpenSSL#Heartbleed_bug 839 // https://en.wikipedia.org/wiki/OpenSSL#Heartbleed_bug
838 if (OPENSSL_VERSION_NUMBER < 0x1000107fL /* openssl-1.0.1g */ && 840 if (OPENSSL_VERSION_NUMBER < 0x1000107fL /* openssl-1.0.1g */ &&
978 { 980 {
979 Stop(); 981 Stop();
980 httpCompression_ = enabled; 982 httpCompression_ = enabled;
981 LOG(WARNING) << "HTTP compression is " << (enabled ? "enabled" : "disabled"); 983 LOG(WARNING) << "HTTP compression is " << (enabled ? "enabled" : "disabled");
982 } 984 }
985
986 void MongooseServer::SetDescribeErrorsEnabled(bool enabled)
987 {
988 describeErrors_ = enabled;
989 LOG(INFO) << "Description of the errors in the HTTP answers is " << (enabled ? "enabled" : "disabled");
990 }
983 991
984 void MongooseServer::SetIncomingHttpRequestFilter(IIncomingHttpRequestFilter& filter) 992 void MongooseServer::SetIncomingHttpRequestFilter(IIncomingHttpRequestFilter& filter)
985 { 993 {
986 Stop(); 994 Stop();
987 filter_ = &filter; 995 filter_ = &filter;