1
0
Fork 0
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:
King_DuckZ 2017-04-25 22:08:03 +01:00
parent 85784d231d
commit 8a23dc1add
2 changed files with 2 additions and 2 deletions

View file

@ -33,7 +33,7 @@ namespace tawashi {
void PastieResponse::on_process() {
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");
m_plain_text = true;
}

View file

@ -96,7 +96,7 @@ namespace tawashi {
}
//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);
boost::optional<std::string> token = submit_to_redis(pastie, duration_int, lang);
if (token) {