diff Core/HttpServer/EmbeddedResourceHttpHandler.cpp @ 1113:ba5c0908600c

Refactoring of HttpOutput ("Content-Length" header is now always sent)
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 02 Sep 2014 15:51:20 +0200
parents 8d1845feb277
children 6e7e5ed91c2d
line wrap: on
line diff
--- a/Core/HttpServer/EmbeddedResourceHttpHandler.cpp	Mon Sep 01 12:20:26 2014 +0200
+++ b/Core/HttpServer/EmbeddedResourceHttpHandler.cpp	Tue Sep 02 15:51:20 2014 +0200
@@ -78,12 +78,14 @@
     {
       const void* buffer = EmbeddedResources::GetDirectoryResourceBuffer(resourceId_, resourcePath.c_str());
       size_t size = EmbeddedResources::GetDirectoryResourceSize(resourceId_, resourcePath.c_str());
-      output.AnswerBufferWithContentType(buffer, size, contentType);
+
+      output.SetContentType(contentType.c_str());
+      output.SendBody(buffer, size);
     }
     catch (OrthancException&)
     {
       LOG(WARNING) << "Unable to find HTTP resource: " << resourcePath;
-      output.SendHeader(HttpStatus_404_NotFound);
+      output.SendStatus(HttpStatus_404_NotFound);
     }
 
     return true;