changeset 282:f8e801a678ca

fix
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 28 Aug 2018 20:56:47 +0200
parents 38c795cc7c48
children 3a8bac805352
files Applications/IBasicApplication.cpp
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/IBasicApplication.cpp	Fri Jul 20 11:01:50 2018 +0200
+++ b/Applications/IBasicApplication.cpp	Tue Aug 28 20:56:47 2018 +0200
@@ -189,14 +189,22 @@
         webService.SetUrl(parameters["orthanc"].as<std::string>());
       }
 
+      std::string username, password;
+      
       if (parameters.count("username"))
       {
-        webService.SetUsername(parameters["username"].as<std::string>());
+        username = parameters["username"].as<std::string>();
       }
 
       if (parameters.count("password"))
       {
-        webService.SetPassword(parameters["password"].as<std::string>());
+        password = parameters["password"].as<std::string>();
+      }
+
+      if (!username.empty() ||
+          !password.empty())
+      {
+        webService.SetCredentials(username, password);
       }
 
       LOG(WARNING) << "URL to the Orthanc REST API: " << webService.GetUrl();