changeset 718:d58006a63366

fix false error logs
author Alain Mazy <am@orthanc.team>
date Thu, 14 Aug 2025 15:53:08 +0200
parents a90d16a5a27d
children 8c9c5683545c
files NEWS Plugin/Configuration.cpp
diffstat 2 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Tue Jul 22 11:23:54 2025 +0200
+++ b/NEWS	Thu Aug 14 15:53:08 2025 +0200
@@ -8,6 +8,8 @@
 * New configuration "EnablePerformanceLogs" to display performance logs.  Currently
   only showing the time required to execute a WADO-RS query.  For example:
   WADO-RS: elapsed: 26106623 us, rate: 14.86 instances/s, 155.23Mbps
+* Fix false errors logs generated e.g when OHIF requests the /dicom-web/studies/../metadata route:
+  "dicom-web:/Configuration.cpp:643] Unsupported return MIME type: application/dicom+json, multipart/related; type=application/octet-stream; transfer-syntax=*, will return DICOM+JSON"
 
 
 Version 1.20 (2025-05-12)
--- a/Plugin/Configuration.cpp	Tue Jul 22 11:23:54 2025 +0200
+++ b/Plugin/Configuration.cpp	Thu Aug 14 15:53:08 2025 +0200
@@ -626,21 +626,21 @@
       std::string accept;
       Orthanc::Toolbox::ToLowerCase(accept, acceptHeader);
   
-      if (accept == "application/dicom+json" ||
-          accept == "application/json" ||
-          accept == "*/*")
+      if (accept.find("application/dicom+json") != std::string::npos ||
+          accept.find("application/json") != std::string::npos ||
+          accept.find("*/*")  != std::string::npos)
       {
         return false;
       }
-      else if (accept == "application/dicom+xml" ||
-               accept == "application/xml" ||
-               accept == "text/xml")
+      else if (accept.find("application/dicom+xml") != std::string::npos ||
+               accept.find("application/xml") != std::string::npos ||
+               accept.find("text/xml")  != std::string::npos)
       {
         return true;
       }
       else
       {
-        LOG(ERROR) << "Unsupported return MIME type: " << accept <<
+        LOG(WARNING) << "Unsupported return MIME type: " << accept <<
                       ", will return DICOM+JSON";
         return false;
       }