Mercurial > hg > orthanc
changeset 4367:189e48f4a92a
Allow empty request body in "/modalities/{id}/echo"
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 10 Dec 2020 18:36:57 +0100 |
parents | 6a39ca7083b9 |
children | 781f53eee856 39bc2fb4657b |
files | NEWS OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp |
diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS Thu Dec 10 09:32:39 2020 +0100 +++ b/NEWS Thu Dec 10 18:36:57 2020 +0100 @@ -16,6 +16,7 @@ ----------- * Allow concurrency on the OrthancPluginRegisterIncomingHttpRequestFilter() callbacks +* Allow empty request body in "/modalities/{id}/echo" Version 1.8.1 (2020-12-07)
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp Thu Dec 10 09:32:39 2020 +0100 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestModalities.cpp Thu Dec 10 18:36:57 2020 +0100 @@ -162,8 +162,10 @@ static void DicomEcho(RestApiPostCall& call) { - Json::Value body; - if (call.ParseJsonRequest(body)) + Json::Value body = Json::objectValue; + + if (call.GetBodySize() == 0 /* allow empty body, was disallowed in Orthanc 1.7.0->1.8.1 */ || + call.ParseJsonRequest(body)) { const DicomAssociationParameters parameters = GetAssociationParameters(call, body); ExecuteEcho(call.GetOutput(), parameters, body);