Bug 165

Summary: Boundary parameter in multipart Content-Type should conform specification
Product: Orthanc Reporter: Sébastien Jodogne <s.jodogne>
Component: Orthanc CoreAssignee: Sébastien Jodogne <s.jodogne>
Status: RESOLVED FIXED    
Severity: normal    
Priority: ---    
Version: unspecified   
Hardware: All   
OS: All   

Description Sébastien Jodogne 2020-06-29 15:16:28 CEST
[BitBucket user: Kiryl Verkhovin]
[BitBucket date: 2020-01-22.19:13:30]

Some clients fail to parse multipart http response from Orthanc server because of incorrect boundary parameter

**What steps will reproduce the problem?**

Retrieve a study through dicom-web api:  GET dicom-web/studies/\{study\}



[RFC 1521 ](https://tools.ietf.org/html/rfc1521)states the following:

> The only mandatory parameter for the multipart Content-Type is the boundary parameter, which consists of 1 to 70 characters from a set of characters known to be very robust through email gateways, and NOT ending with white space.

[Current implementation](https://hg.orthanc-server.com/orthanc/file/a77e7839012ac2355d3136b0c8736edf193a1605/Core/HttpServer/HttpOutput.cpp) uses the following code to generate boundary value:



```c++
boundary = Toolbox::GenerateUuid() + "-" + Toolbox::GenerateUuid();
```

The size of uuid is 36 bytes, plus hyphen sign leads to 73 characters in total.
Comment 1 Sébastien Jodogne 2020-06-29 15:26:38 CEST
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2020-01-23.11:58:21]

Fix issue #165

→ https://hg.orthanc-server.com/orthanc/changeset/b6a569e6e85b
Comment 2 Sébastien Jodogne 2020-06-29 15:26:38 CEST
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2020-01-23.11:58:49]

Thanks for the report!