mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2025-08-03 12:50:02 +00:00
Make on_process() return an HttpHeader.
Response type is now decided by on_process' return value.
This commit is contained in:
parent
c5f2bc055a
commit
cdd23d35d0
10 changed files with 280 additions and 75 deletions
|
@ -18,11 +18,11 @@
|
|||
#pragma once
|
||||
|
||||
#include "response.hpp"
|
||||
#include "error_reasons.hpp"
|
||||
#include <string>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/utility/string_ref.hpp>
|
||||
#include <cassert>
|
||||
#include <utility>
|
||||
|
||||
namespace tawashi {
|
||||
class SubmitPasteResponse : public Response {
|
||||
|
@ -37,8 +37,8 @@ namespace tawashi {
|
|||
virtual boost::string_ref page_basename() const override { assert(false); return boost::string_ref(""); }
|
||||
|
||||
private:
|
||||
virtual void on_process() override;
|
||||
boost::optional<std::string> submit_to_redis (const boost::string_ref& parText, uint32_t parExpiry, const boost::string_ref& parLang);
|
||||
void error_redirect (int parCode, ErrorReasons parReason);
|
||||
typedef std::pair<boost::optional<std::string>, HttpHeader> StringOrHeader;
|
||||
virtual HttpHeader on_process() override;
|
||||
StringOrHeader submit_to_redis (const boost::string_ref& parText, uint32_t parExpiry, const boost::string_ref& parLang);
|
||||
};
|
||||
} //namespace tawashi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue