Mercurial > hg > orthanc
comparison Core/HttpServer/MongooseServer.cpp @ 2790:c7313e1f7644
MongooseServer::SetRealm()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 26 Jul 2018 20:43:03 +0200 |
parents | 33c0b4da8cb2 |
children | 7133ad478eea |
comparison
equal
deleted
inserted
replaced
2789:2a4ac74da1ed | 2790:c7313e1f7644 |
---|---|
609 | 609 |
610 // Check remote calls | 610 // Check remote calls |
611 if (!server.IsRemoteAccessAllowed() && | 611 if (!server.IsRemoteAccessAllowed() && |
612 !localhost) | 612 !localhost) |
613 { | 613 { |
614 output.SendUnauthorized(ORTHANC_REALM); | 614 output.SendUnauthorized(server.GetRealm()); |
615 return; | 615 return; |
616 } | 616 } |
617 | 617 |
618 | 618 |
619 // Extract the HTTP headers | 619 // Extract the HTTP headers |
653 | 653 |
654 // Authenticate this connection | 654 // Authenticate this connection |
655 if (server.IsAuthenticationEnabled() && | 655 if (server.IsAuthenticationEnabled() && |
656 !IsAccessGranted(server, headers)) | 656 !IsAccessGranted(server, headers)) |
657 { | 657 { |
658 output.SendUnauthorized(ORTHANC_REALM); | 658 output.SendUnauthorized(server.GetRealm()); |
659 return; | 659 return; |
660 } | 660 } |
661 | 661 |
662 | 662 |
663 #if ORTHANC_ENABLE_MONGOOSE == 1 | 663 #if ORTHANC_ENABLE_MONGOOSE == 1 |
680 if (filter != NULL) | 680 if (filter != NULL) |
681 { | 681 { |
682 if (!filter->IsAllowed(method, request->uri, remoteIp, | 682 if (!filter->IsAllowed(method, request->uri, remoteIp, |
683 username.c_str(), headers, argumentsGET)) | 683 username.c_str(), headers, argumentsGET)) |
684 { | 684 { |
685 //output.SendUnauthorized(ORTHANC_REALM); | 685 //output.SendUnauthorized(server.GetRealm()); |
686 output.SendStatus(HttpStatus_403_Forbidden); | 686 output.SendStatus(HttpStatus_403_Forbidden); |
687 return; | 687 return; |
688 } | 688 } |
689 } | 689 } |
690 | 690 |
915 port_ = 8000; | 915 port_ = 8000; |
916 filter_ = NULL; | 916 filter_ = NULL; |
917 keepAlive_ = false; | 917 keepAlive_ = false; |
918 httpCompression_ = true; | 918 httpCompression_ = true; |
919 exceptionFormatter_ = NULL; | 919 exceptionFormatter_ = NULL; |
920 realm_ = ORTHANC_REALM; | |
920 | 921 |
921 #if ORTHANC_ENABLE_SSL == 1 | 922 #if ORTHANC_ENABLE_SSL == 1 |
922 // Check for the Heartbleed exploit | 923 // Check for the Heartbleed exploit |
923 // https://en.wikipedia.org/wiki/OpenSSL#Heartbleed_bug | 924 // https://en.wikipedia.org/wiki/OpenSSL#Heartbleed_bug |
924 if (OPENSSL_VERSION_NUMBER < 0x1000107fL /* openssl-1.0.1g */ && | 925 if (OPENSSL_VERSION_NUMBER < 0x1000107fL /* openssl-1.0.1g */ && |