# HG changeset patch # User Alain Mazy # Date 1645000045 -3600 # Node ID a29a6bdba9dd34d729a3a2eef1831a6e2694ce9a # Parent 228ce71e08a3444ec3c005d2e974188514f16d42 mime type for .ico diff -r 228ce71e08a3 -r a29a6bdba9dd OrthancFramework/Sources/Enumerations.cpp --- a/OrthancFramework/Sources/Enumerations.cpp Tue Feb 15 18:09:03 2022 +0100 +++ b/OrthancFramework/Sources/Enumerations.cpp Wed Feb 16 09:27:25 2022 +0100 @@ -52,6 +52,7 @@ static const char* const MIME_ZIP = "application/zip"; static const char* const MIME_DICOM_WEB_JSON = "application/dicom+json"; static const char* const MIME_DICOM_WEB_XML = "application/dicom+xml"; + static const char* const MIME_ICO = "image/x-icon"; // This function is autogenerated by the script // "Resources/GenerateErrorCodes.py" @@ -1098,7 +1099,10 @@ case MimeType_DicomWebXml: return MIME_DICOM_WEB_XML; - + + case MimeType_Ico: + return MIME_ICO; + default: throw OrthancException(ErrorCode_ParameterOutOfRange); } @@ -1807,6 +1811,11 @@ target = MimeType_DicomWebXml; return true; } + else if (source == MIME_ICO) + { + target = MimeType_Ico; + return true; + } else { return false; diff -r 228ce71e08a3 -r a29a6bdba9dd OrthancFramework/Sources/Enumerations.h --- a/OrthancFramework/Sources/Enumerations.h Tue Feb 15 18:09:03 2022 +0100 +++ b/OrthancFramework/Sources/Enumerations.h Wed Feb 16 09:27:25 2022 +0100 @@ -78,7 +78,8 @@ MimeType_Zip, MimeType_PrometheusText, // Prometheus text-based exposition format (for metrics) MimeType_DicomWebJson, - MimeType_DicomWebXml + MimeType_DicomWebXml, + MimeType_Ico }; diff -r 228ce71e08a3 -r a29a6bdba9dd OrthancFramework/Sources/SystemToolbox.cpp --- a/OrthancFramework/Sources/SystemToolbox.cpp Tue Feb 15 18:09:03 2022 +0100 +++ b/OrthancFramework/Sources/SystemToolbox.cpp Wed Feb 16 09:27:25 2022 +0100 @@ -813,6 +813,10 @@ { return MimeType_Woff2; } + else if (extension == ".ico") + { + return MimeType_Ico; + } // Default type else diff -r 228ce71e08a3 -r a29a6bdba9dd OrthancFramework/UnitTestsSources/FrameworkTests.cpp --- a/OrthancFramework/UnitTestsSources/FrameworkTests.cpp Tue Feb 15 18:09:03 2022 +0100 +++ b/OrthancFramework/UnitTestsSources/FrameworkTests.cpp Wed Feb 16 09:27:25 2022 +0100 @@ -342,6 +342,7 @@ ASSERT_EQ(MimeType_Svg, SystemToolbox::AutodetectMimeType("NOTES.svg")); ASSERT_EQ(MimeType_Woff, SystemToolbox::AutodetectMimeType("NOTES.woff")); ASSERT_EQ(MimeType_Woff2, SystemToolbox::AutodetectMimeType("NOTES.woff2")); + ASSERT_EQ(MimeType_Ico, SystemToolbox::AutodetectMimeType("NOTES.ico")); // Test primitives from the "RegisterDefaultExtensions()" that was // present in the sample "Serve Folders plugin" of Orthanc 1.4.2