changeset 3617:afdda32d89e6 storage-commitment

integration mainline->storage-commitment
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 23 Jan 2020 12:58:38 +0100
parents 169d57e18b39 (current diff) b6a569e6e85b (diff)
children 1fe74e7d9646
files
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Core/HttpServer/HttpOutput.cpp	Tue Jan 21 17:52:47 2020 +0100
+++ b/Core/HttpServer/HttpOutput.cpp	Thu Jan 23 12:58:38 2020 +0100
@@ -463,6 +463,21 @@
     }
 
     boundary = Toolbox::GenerateUuid() + "-" + Toolbox::GenerateUuid();
+
+    /**
+     * Fix for issue #165: "Encapsulation boundaries must not appear
+     * within the encapsulations, and must be no longer than 70
+     * characters, not counting the two leading hyphens."
+     * https://tools.ietf.org/html/rfc1521
+     * https://bitbucket.org/sjodogne/orthanc/issues/165/
+     **/
+    if (boundary.size() != 36 + 1 + 36)  // one UUID contains 36 characters
+    {
+      throw OrthancException(ErrorCode_InternalError);
+    }
+    
+    boundary = boundary.substr(0, 70);
+    
     contentTypeHeader = ("multipart/" + subType + "; type=" + tmp + "; boundary=" + boundary);
   }
 
--- a/NEWS	Tue Jan 21 17:52:47 2020 +0100
+++ b/NEWS	Thu Jan 23 12:58:38 2020 +0100
@@ -15,6 +15,7 @@
 * C-Find SCU at Instance level now sets the 0008,0052 tag to IMAGE per default (was INSTANCE).
   Therefore, the "ClearCanvas" and "Dcm4Chee" modality manufacturer have now been deprecated.
 * Fix issue #156 (Chunked Dicom-web transfer uses 100% CPU)
+* Fix issue #165 (Boundary parameter in multipart Content-Type is too long)
 * /instances/{id}/preview route now takes the windowing into account
 
 Version 1.5.8 (2019-10-16)