Mercurial > hg > orthanc-dicomweb
changeset 396:ff965186c485
typo
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 03 Mar 2020 16:18:33 +0100 |
parents | 93c57d07a0d1 |
children | 3bfa030bd6a3 |
files | Plugin/DicomWebClient.cpp |
diffstat | 1 files changed, 28 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/Plugin/DicomWebClient.cpp Tue Mar 03 16:12:59 2020 +0100 +++ b/Plugin/DicomWebClient.cpp Tue Mar 03 16:18:33 2020 +0100 @@ -1120,8 +1120,8 @@ { throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol, "No Content-Type provided by the remote WADO-RS server, " - "your remote server might need option \"" + - HAS_WADO_RS_UNIVERSAL_TRANSFER_SYNTAX + "\" set to \"true\""); + "your remote DICOMweb server might need client option \"" + + HAS_WADO_RS_UNIVERSAL_TRANSFER_SYNTAX + "\" set to \"false\""); } else { @@ -1292,37 +1292,38 @@ if (headers.find("Accept") == headers.end()) { + bool hasUniversal; + // The "Accept" field was not provided in the "HttpHeaders" // field of the POST body of: "/dicom-web/servers/.../retrieve" std::map<std::string, std::string>::const_iterator found = userProperties.find(HAS_WADO_RS_UNIVERSAL_TRANSFER_SYNTAX); - if (found != userProperties.end()) + if (found == userProperties.end()) + { + hasUniversal = true; // By default, assume "true" + } + else if (found->second == "true" || + found->second == "1") + { + hasUniversal = true; + } + else if (found->second == "false" || + found->second == "0") { - bool hasUniversal; - - if (found->second == "true" || - found->second == "1") - { - hasUniversal = true; - } - else if (found->second == "false" || - found->second == "0") - { - hasUniversal = false; - } - else - { - throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange, - "Configuration option \"" + HAS_WADO_RS_UNIVERSAL_TRANSFER_SYNTAX + - "\" of remote DICOMweb server \"" + serverName_ + - "\" must be a Boolean, found: " + found->second); - } - - if (hasUniversal) - { - client.AddHeader("Accept", "multipart/related; type=\"application/dicom\"; transfer-syntax=*"); - } + hasUniversal = false; + } + else + { + throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange, + "Configuration option \"" + HAS_WADO_RS_UNIVERSAL_TRANSFER_SYNTAX + + "\" of remote DICOMweb server \"" + serverName_ + + "\" must be a Boolean, found: " + found->second); + } + + if (hasUniversal) + { + client.AddHeader("Accept", "multipart/related; type=\"application/dicom\"; transfer-syntax=*"); } }