diff OrthancServer/ServerContext.cpp @ 1146:200fcac0deb4

optimization for access to attachments
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 11 Sep 2014 14:04:48 +0200
parents 0479d02c6778
children 0561f2087cc9
line wrap: on
line diff
--- a/OrthancServer/ServerContext.cpp	Thu Sep 11 13:06:16 2014 +0200
+++ b/OrthancServer/ServerContext.cpp	Thu Sep 11 14:04:48 2014 +0200
@@ -391,9 +391,9 @@
 
 
 
-  void ServerContext::AnswerDicomFile(RestApiOutput& output,
-                                      const std::string& instancePublicId,
-                                      FileContentType content)
+  void ServerContext::AnswerAttachment(RestApiOutput& output,
+                                       const std::string& instancePublicId,
+                                       FileContentType content)
   {
     FileInfo attachment;
     if (!index_.LookupAttachment(attachment, instancePublicId, content))
@@ -404,7 +404,7 @@
     accessor_.SetCompressionForNextOperations(attachment.GetCompressionType());
 
     std::auto_ptr<HttpFileSender> sender(accessor_.ConstructHttpFileSender(attachment.GetUuid(), attachment.GetContentType()));
-    sender->SetContentType("application/dicom");
+    sender->SetContentType(GetMimeType(content));
     sender->SetDownloadFilename(instancePublicId + ".dcm");
     output.AnswerFile(*sender);
   }