# HG changeset patch # User Sebastien Jodogne # Date 1448561355 -3600 # Node ID b7da58699f929efcdde60697f712a992639960a8 # Parent 3ae2ff2496756f25a0369c61d895b12e40da0811 Fix formatting of multipart HTTP answers diff -r 3ae2ff249675 -r b7da58699f92 Core/HttpServer/HttpOutput.cpp --- a/Core/HttpServer/HttpOutput.cpp Thu Nov 26 18:53:00 2015 +0100 +++ b/Core/HttpServer/HttpOutput.cpp Thu Nov 26 19:09:15 2015 +0100 @@ -451,10 +451,10 @@ void HttpOutput::StateMachine::SendMultipartItem(const void* item, size_t length) { - std::string header = "--" + multipartBoundary_ + "\n"; - header += "Content-Type: " + multipartContentType_ + "\n"; - header += "Content-Length: " + boost::lexical_cast(length) + "\n"; - header += "MIME-Version: 1.0\n\n"; + std::string header = "--" + multipartBoundary_ + "\r\n"; + header += "Content-Type: " + multipartContentType_ + "\r\n"; + header += "Content-Length: " + boost::lexical_cast(length) + "\r\n"; + header += "MIME-Version: 1.0\r\n\r\n"; stream_.Send(false, header.c_str(), header.size()); @@ -463,7 +463,7 @@ stream_.Send(false, item, length); } - stream_.Send(false, "\n", 1); + stream_.Send(false, "\r\n", 1); } @@ -478,7 +478,7 @@ // closed the connection. Such an error is ignored. try { - std::string header = "--" + multipartBoundary_ + "--\n"; + std::string header = "--" + multipartBoundary_ + "--\r\n"; stream_.Send(false, header.c_str(), header.size()); } catch (OrthancException&) diff -r 3ae2ff249675 -r b7da58699f92 NEWS --- a/NEWS Thu Nov 26 18:53:00 2015 +0100 +++ b/NEWS Thu Nov 26 19:09:15 2015 +0100 @@ -67,6 +67,7 @@ * Many refactorings, notably of the searching features and of the image decoding * C-Move SCP for studies using AccessionNumber tag * Fix issue 4 (C-Store Association not renegotiated on Specific-to-specific transfer syntax change) +* Fix formatting of multipart HTTP answers * "--logdir" flag creates a single log file instead of 3 separate files for errors/warnings/infos * "--errors" flag lists the error codes that could be returned by Orthanc * Under Windows, the exit status of Orthanc corresponds to the encountered error code