1
0
Fork 0
mirror of https://github.com/KingDuckZ/kamokan.git synced 2025-08-19 13:29:49 +00:00

Fix the bug with the pastie token being invalid.

REQUEST_URI would return "ba"?cpp for example, but
the code expects just "ba".
This commit is contained in:
King_DuckZ 2017-06-06 19:55:22 +01:00
parent e44611301c
commit df1afc7616
4 changed files with 24 additions and 1 deletions

View file

@ -128,6 +128,22 @@ namespace tawashi {
opt_string_list pastie_reply = m_redis->hmget(parToken, "pastie");
opt_string pastie = (pastie_reply and not pastie_reply->empty() ? (*pastie_reply)[0] : opt_string());
#if defined(SPDLOG_DEBUG_ON)
{
auto statuslog = spdlog::get("statuslog");
if (pastie) {
statuslog->debug("Retrieving pastie with token \"{}\" gave a result of size {}",
std::string(parToken.data(), parToken.size()),
pastie->size()
);
}
else {
statuslog->debug("Retrieving pastie with token \"{}\" gave no results",
std::string(parToken.data(), parToken.size())
);
}
}
#endif
return pastie;
}