# HG changeset patch # User Sebastien Jodogne # Date 1579780718 -3600 # Node ID afdda32d89e614dd422c7c52012bb3397752b2d5 # Parent 169d57e18b39b61273d1b03169cb1e530b134343# Parent b6a569e6e85bbee2e40fca719cf8c5f2ed76024f integration mainline->storage-commitment diff -r 169d57e18b39 -r afdda32d89e6 Core/HttpServer/HttpOutput.cpp --- 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); } diff -r 169d57e18b39 -r afdda32d89e6 NEWS --- 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)