Mercurial > hg > orthanc-stone
comparison Framework/Oracle/GenericOracleRunner.cpp @ 1079:e6d2ff8f1ab4 broker
credentials in HttpCommand
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 17 Oct 2019 21:25:03 +0200 |
parents | d7a18a3cd6f9 |
children | 17660df24c36 |
comparison
equal
deleted
inserted
replaced
1078:53d9c3b96b9e | 1079:e6d2ff8f1ab4 |
---|---|
96 client.SetMethod(command.GetMethod()); | 96 client.SetMethod(command.GetMethod()); |
97 client.SetTimeout(command.GetTimeout()); | 97 client.SetTimeout(command.GetTimeout()); |
98 | 98 |
99 CopyHttpHeaders(client, command.GetHttpHeaders()); | 99 CopyHttpHeaders(client, command.GetHttpHeaders()); |
100 | 100 |
101 if (command.HasCredentials()) | |
102 { | |
103 client.SetCredentials(command.GetUsername().c_str(), command.GetPassword().c_str()); | |
104 } | |
105 | |
101 if (command.GetMethod() == Orthanc::HttpMethod_Post || | 106 if (command.GetMethod() == Orthanc::HttpMethod_Post || |
102 command.GetMethod() == Orthanc::HttpMethod_Put) | 107 command.GetMethod() == Orthanc::HttpMethod_Put) |
103 { | 108 { |
104 client.SetBody(command.GetBody()); | 109 client.SetBody(command.GetBody()); |
105 } | 110 } |
194 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadParameterType, | 199 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadParameterType, |
195 "Sleep command cannot be executed by the runner"); | 200 "Sleep command cannot be executed by the runner"); |
196 break; | 201 break; |
197 | 202 |
198 case IOracleCommand::Type_Http: | 203 case IOracleCommand::Type_Http: |
199 Execute(emitter_, receiver, | 204 Execute(emitter_, receiver, dynamic_cast<const HttpCommand&>(command)); |
200 dynamic_cast<const HttpCommand&>(command)); | |
201 break; | 205 break; |
202 | 206 |
203 case IOracleCommand::Type_OrthancRestApi: | 207 case IOracleCommand::Type_OrthancRestApi: |
204 Execute(emitter_, orthanc_, receiver, dynamic_cast<const OrthancRestApiCommand&>(command)); | 208 Execute(emitter_, orthanc_, receiver, dynamic_cast<const OrthancRestApiCommand&>(command)); |
205 break; | 209 break; |