diff Core/HttpServer/HttpFileSender.cpp @ 324:64925c94825c

api improvement
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 08 Jan 2013 09:29:56 +0100
parents 1ac3aacd10a5
children 78a8eaa5f30b
line wrap: on
line diff
--- a/Core/HttpServer/HttpFileSender.cpp	Mon Jan 07 16:48:35 2013 +0100
+++ b/Core/HttpServer/HttpFileSender.cpp	Tue Jan 08 09:29:56 2013 +0100
@@ -38,20 +38,20 @@
 {
   void HttpFileSender::SendHeader(HttpOutput& output)
   {
-    std::string header;
-    header += "Content-Length: " + boost::lexical_cast<std::string>(GetFileSize()) + "\r\n";
+    HttpHandler::Arguments header;
+    header["Content-Length"] = boost::lexical_cast<std::string>(GetFileSize());
 
     if (contentType_.size() > 0)
     {
-      header += "Content-Type: " + contentType_ + "\r\n";
+      header["Content-Type"] = contentType_;
     }
 
     if (downloadFilename_.size() > 0)
     {
-      header += "Content-Disposition: attachment; filename=\"" + downloadFilename_ + "\"\r\n";
+      header["Content-Disposition"] = "attachment; filename=\"" + downloadFilename_ + "\"";
     }
   
-    output.SendCustomOkHeader(header);
+    output.SendOkHeader(header);
   }
 
   void HttpFileSender::Send(HttpOutput& output)