# HG changeset patch # User Sebastien Jodogne # Date 1541598403 -3600 # Node ID 78f0557d70ee8a253e9731b235e9c6111d298e36 # Parent 15273c57e9367a4d918eb12f6d9b3e8e5d8d2f3a Sending "HttpHeaders" of the "DicomWeb.Servers" configuration to remote DICOMweb servers diff -r 15273c57e936 -r 78f0557d70ee NEWS --- a/NEWS Tue Sep 04 09:58:35 2018 +0200 +++ b/NEWS Wed Nov 07 14:46:43 2018 +0100 @@ -1,6 +1,8 @@ Pending changes in the mainline =============================== +* Sending "HttpHeaders" of the "DicomWeb.Servers" configuration to remote DICOMweb servers + Version 0.5 (2018-04-19) ======================== diff -r 15273c57e936 -r 78f0557d70ee Plugin/DicomWebServers.cpp --- a/Plugin/DicomWebServers.cpp Tue Sep 04 09:58:35 2018 +0200 +++ b/Plugin/DicomWebServers.cpp Wed Nov 07 14:46:43 2018 +0100 @@ -154,18 +154,32 @@ url += uri; } - std::vector httpHeadersKeys(httpHeaders.size()); - std::vector httpHeadersValues(httpHeaders.size()); + std::map allHttpHeaders = server.GetHttpHeaders(); + + { + // Add the user-specified HTTP headers to the HTTP headers + // coming from the Orthanc configuration file + for (std::map::const_iterator + it = httpHeaders.begin(); it != httpHeaders.end(); ++it) + { + allHttpHeaders[it->first] = it->second; + } + } + + std::vector httpHeadersKeys(allHttpHeaders.size()); + std::vector httpHeadersValues(allHttpHeaders.size()); { size_t pos = 0; for (std::map::const_iterator - it = httpHeaders.begin(); it != httpHeaders.end(); ++it) + it = allHttpHeaders.begin(); it != allHttpHeaders.end(); ++it) { httpHeadersKeys[pos] = it->first.c_str(); httpHeadersValues[pos] = it->second.c_str(); pos += 1; } + + assert(pos == allHttpHeaders.size()); } const char* bodyContent = NULL; @@ -190,7 +204,7 @@ method, url.c_str(), /* HTTP headers*/ - httpHeaders.size(), + allHttpHeaders.size(), httpHeadersKeys.empty() ? NULL : &httpHeadersKeys[0], httpHeadersValues.empty() ? NULL : &httpHeadersValues[0], bodyContent, bodySize,