Mercurial > hg > orthanc
comparison OrthancServer/OrthancRestApi/OrthancRestArchive.cpp @ 3240:e44e0127e553
Fix issue #134 (/patient/modify gives 500, should really be 400)
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 15 Feb 2019 17:26:45 +0100 |
parents | 6fd38327e777 |
children | 94f4a18a79cc |
comparison
equal
deleted
inserted
replaced
3239:407e1a188105 | 3240:e44e0127e553 |
---|---|
145 } | 145 } |
146 | 146 |
147 job->SetSynchronousTarget(tmp); | 147 job->SetSynchronousTarget(tmp); |
148 | 148 |
149 Json::Value publicContent; | 149 Json::Value publicContent; |
150 if (context.GetJobsEngine().GetRegistry().SubmitAndWait | 150 context.GetJobsEngine().GetRegistry().SubmitAndWait |
151 (publicContent, job.release(), priority)) | 151 (publicContent, job.release(), priority); |
152 | |
152 { | 153 { |
153 // The archive is now created: Prepare the sending of the ZIP file | 154 // The archive is now created: Prepare the sending of the ZIP file |
154 FilesystemHttpSender sender(tmp->GetPath(), MimeType_Zip); | 155 FilesystemHttpSender sender(tmp->GetPath(), MimeType_Zip); |
155 sender.SetContentFilename(filename); | 156 sender.SetContentFilename(filename); |
156 | 157 |
157 // Send the ZIP | 158 // Send the ZIP |
158 output.AnswerStream(sender); | 159 output.AnswerStream(sender); |
159 } | |
160 else | |
161 { | |
162 output.SignalError(HttpStatus_500_InternalServerError); | |
163 } | 160 } |
164 } | 161 } |
165 else | 162 else |
166 { | 163 { |
167 OrthancRestApi::SubmitGenericJob(output, context, job.release(), false, priority); | 164 OrthancRestApi::SubmitGenericJob(output, context, job.release(), false, priority); |