1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2025-02-25 09:53:54 +00:00

Set plain text mode *before* returning.

This commit is contained in:
King_DuckZ 2017-05-22 20:28:18 +01:00
parent 9f8d89895d
commit 6ea74d090a

View file

@ -46,8 +46,8 @@ namespace tawashi {
auto get = cgi_env().query_string_split(); auto get = cgi_env().query_string_split();
const std::string& query_str(cgi_env().query_string()); const std::string& query_str(cgi_env().query_string());
if (get["m"] == "plain" or query_str.empty()) { if (get["m"] == "plain" or query_str.empty()) {
return make_header_type_text_utf8();
m_plain_text = true; m_plain_text = true;
return make_header_type_text_utf8();
} }
else if (query_str == g_nolang_token) { else if (query_str == g_nolang_token) {
m_syntax_highlight = false; m_syntax_highlight = false;
@ -68,7 +68,7 @@ namespace tawashi {
using opt_string = redis::IncRedis::opt_string; using opt_string = redis::IncRedis::opt_string;
using opt_string_list = redis::IncRedis::opt_string_list; using opt_string_list = redis::IncRedis::opt_string_list;
auto token = boost::string_ref(cgi_env().path_info()); boost::string_ref token = cgi_env().path_info();
auto& redis = this->redis(); auto& redis = this->redis();
opt_string_list pastie_reply = redis.hmget(token, "pastie"); opt_string_list pastie_reply = redis.hmget(token, "pastie");
opt_string pastie = (pastie_reply and not pastie_reply->empty() ? (*pastie_reply)[0] : opt_string()); opt_string pastie = (pastie_reply and not pastie_reply->empty() ? (*pastie_reply)[0] : opt_string());