diff --git a/src/pastie_response.cpp b/src/pastie_response.cpp index 497f85b..ca154d0 100644 --- a/src/pastie_response.cpp +++ b/src/pastie_response.cpp @@ -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; } diff --git a/src/submit_paste_response.cpp b/src/submit_paste_response.cpp index 0ff85a9..d609c8a 100644 --- a/src/submit_paste_response.cpp +++ b/src/submit_paste_response.cpp @@ -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(duration)), 2628000U), 1U); boost::optional token = submit_to_redis(pastie, duration_int, lang); if (token) {