mirror of
https://github.com/KingDuckZ/kamokan.git
synced 2025-02-09 09:23:56 +00:00
An empty GET is synonym of m=plain
This commit is contained in:
parent
85784d231d
commit
8a23dc1add
2 changed files with 2 additions and 2 deletions
|
@ -33,7 +33,7 @@ namespace tawashi {
|
||||||
|
|
||||||
void PastieResponse::on_process() {
|
void PastieResponse::on_process() {
|
||||||
auto env = cgi_env().query_string_split();
|
auto env = cgi_env().query_string_split();
|
||||||
if (env["m"] == "plain") {
|
if (env["m"] == "plain" or cgi_env().query_string().empty()) {
|
||||||
this->change_type(Response::ContentType, "text/plain");
|
this->change_type(Response::ContentType, "text/plain");
|
||||||
m_plain_text = true;
|
m_plain_text = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ namespace tawashi {
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: replace boost's lexical_cast with mine when I have some checks
|
//TODO: replace boost's lexical_cast with mine when I have some checks
|
||||||
//oven invalid inputs
|
//over invalid inputs
|
||||||
const uint32_t duration_int = std::max(std::min((duration.empty() ? 86400U : boost::lexical_cast<uint32_t>(duration)), 2628000U), 1U);
|
const uint32_t duration_int = std::max(std::min((duration.empty() ? 86400U : boost::lexical_cast<uint32_t>(duration)), 2628000U), 1U);
|
||||||
boost::optional<std::string> token = submit_to_redis(pastie, duration_int, lang);
|
boost::optional<std::string> token = submit_to_redis(pastie, duration_int, lang);
|
||||||
if (token) {
|
if (token) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue