diff Core/RestApi/RestApiOutput.cpp @ 1042:8d1845feb277

set cookies, not allowed methods, unauthorized in plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 17 Jul 2014 15:55:40 +0200
parents a811bdf8b8eb
children 00f9f36bcd94
line wrap: on
line diff
--- a/Core/RestApi/RestApiOutput.cpp	Thu Jul 17 14:14:15 2014 +0200
+++ b/Core/RestApi/RestApiOutput.cpp	Thu Jul 17 15:55:40 2014 +0200
@@ -73,7 +73,7 @@
     CheckStatus();
     Json::StyledWriter writer;
     std::string s = writer.write(value);
-    output_.AnswerBufferWithContentType(s, "application/json", cookies_);
+    output_.AnswerBufferWithContentType(s, "application/json");
     alreadySent_ = true;
   }
 
@@ -81,7 +81,7 @@
                                    const std::string& contentType)
   {
     CheckStatus();
-    output_.AnswerBufferWithContentType(buffer, contentType, cookies_);
+    output_.AnswerBufferWithContentType(buffer, contentType);
     alreadySent_ = true;
   }
 
@@ -90,7 +90,7 @@
                                    const std::string& contentType)
   {
     CheckStatus();
-    output_.AnswerBufferWithContentType(buffer, length, contentType, cookies_);
+    output_.AnswerBufferWithContentType(buffer, length, contentType);
     alreadySent_ = true;
   }
 
@@ -135,7 +135,7 @@
       v += ";max-age=" + boost::lexical_cast<std::string>(maxAge);
     }
 
-    cookies_[name] = v;
+    output_.SetCookie(name, v);
   }
 
   void RestApiOutput::ResetCookie(const std::string& name)