# HG changeset patch # User Sebastien Jodogne # Date 1780405391 -7200 # Node ID 3417bcf097a0ff1da905fee285e4a1adcd59bfbe # Parent 029233bb06c4c1ae3654143602df5b568eac905c fix handling of content range diff -r 029233bb06c4 -r 3417bcf097a0 OrthancFramework/Sources/FileStorage/StorageRange.cpp --- a/OrthancFramework/Sources/FileStorage/StorageRange.cpp Tue Jun 02 14:41:38 2026 +0200 +++ b/OrthancFramework/Sources/FileStorage/StorageRange.cpp Tue Jun 02 15:03:11 2026 +0200 @@ -245,6 +245,10 @@ { range.SetStartInclusive(tmp); } + else + { + throw OrthancException(ErrorCode_BadRange); + } } if (!tokens[1].empty()) @@ -253,6 +257,10 @@ { range.SetEndInclusive(tmp); } + else + { + throw OrthancException(ErrorCode_BadRange); + } } range.SanityCheck(); diff -r 029233bb06c4 -r 3417bcf097a0 OrthancFramework/Sources/Toolbox.cpp --- a/OrthancFramework/Sources/Toolbox.cpp Tue Jun 02 14:41:38 2026 +0200 +++ b/OrthancFramework/Sources/Toolbox.cpp Tue Jun 02 15:03:11 2026 +0200 @@ -3097,7 +3097,7 @@ if (sizeInBytes < 1024) { std::ostringstream oss; - oss << sizeInBytes << "bytes"; + oss << sizeInBytes << " bytes"; return oss.str(); } else diff -r 029233bb06c4 -r 3417bcf097a0 OrthancFramework/UnitTestsSources/ToolboxTests.cpp --- a/OrthancFramework/UnitTestsSources/ToolboxTests.cpp Tue Jun 02 14:41:38 2026 +0200 +++ b/OrthancFramework/UnitTestsSources/ToolboxTests.cpp Tue Jun 02 15:03:11 2026 +0200 @@ -380,7 +380,7 @@ TEST(Toolbox, GetHumanFileSize) { - ASSERT_EQ("234bytes", Toolbox::GetHumanFileSize(234)); + ASSERT_EQ("234 bytes", Toolbox::GetHumanFileSize(234)); ASSERT_EQ("2.29KB", Toolbox::GetHumanFileSize(2345)); ASSERT_EQ("22.91KB", Toolbox::GetHumanFileSize(23456)); ASSERT_EQ("229.07KB", Toolbox::GetHumanFileSize(234567)); diff -r 029233bb06c4 -r 3417bcf097a0 OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp --- a/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Tue Jun 02 14:41:38 2026 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Tue Jun 02 15:03:11 2026 +0200 @@ -2327,7 +2327,7 @@ .AddAnswerType(MimeType_Binary, "The attachment") .SetAnswerHeader("ETag", "Revision of the attachment, to be used in further `PUT` or `DELETE` operations") .SetHttpHeader("If-None-Match", "Optional revision of the attachment, to check if its content has changed") - .SetHttpHeader("Content-Range", "Optional content range to access part of the attachment (new in Orthanc 1.12.5)"); + .SetHttpHeader("Range", "Optional content range to access part of the attachment (new in Orthanc 1.12.5)"); return; }