5RQCVFRHI353OFKZPVCNJLJLQPEKJVNEDCTM2224U4WABT2YLMQQC
H7NQUYI6KVTFBUHE5MPM6JF6RF4NKYNIYS3AEIT4M2AO7ESSUPNAC
6TPV5GQ3CW6NKF25D6WT2Q2IIRI5N2VMLWUAO2ZMTKIQVUTKYBBAC
TEB4R7OU65GZAGPNINWHOR4Q23OJYVUQK5RT75SV26W7JJEVT5DQC
6NYILMKIHYQMGMCRZANU2FDO66DGINOMCX2J4JFTUI6VL3HZ6D5QC
NY766BOQIWOQUA44QDD7YKQB5GK735ZUJ3YNXXVUUE2VQZP2YWPQC
A2LJT7TTVA6XDEQ6N27T7KKFGBH6AMF6KQI6J7AOVUZDLIN6HCMAC
AEWYJHUD6R45HG4BJSZGH32VJ25H6GU74CL5ZBKI647AKF22HY6QC
3HT5CE6SDTPZAV7EN6FDMY2744JVFJCXHZXEQLK6IEFGPRGSBTXAC
EVP2FSBHQUCAXQ6IIMBD6IS24ODKHP6HFWYCHIMYG6KOFRQG3RVQC
WW3KRXX63EYWW4563QM3VSEN4PGCPR76KJQBYIKCKOCNMDG6JW4QC
4MZ4VIR7FU3PQ3WKJI6TJIKYOIIBODFEPKLMQ32S4AKPZSDFO6AQC
DNFB7TNICXFHRGPNZTT2I4VQNBPGVA2HQMUJWLNEPHF2M4SRZ3SQC
HZDCKIXQ3LCD7YPL7ZZBCRMD7YMKDJ2QAALETTG3FYMBF4TNFUBAC
}
HttpResponse::Found()
.append_header((
header::LOCATION,
format!("slow-game-{}.html", cached_data.0),
))
.finish()
}
pub async fn post_leave_game(
request: HttpRequest,
form: web::Form<JoinLeaveData>,
data: web::Data<WebData<'_>>,
_data_rw: web::Data<DataBaseRw>,
) -> HttpResponse {
let cached_data = {
let mut cache = data.cache_leave_game.lock().await;
cache.remove(&form.csrf)
};
let cached_data = if let Some(cd) = cached_data {
cd
} else {
log::warn!("Unknown data for CSRF: {}", form.csrf);
return HttpResponse::BadRequest().body("Incorrect");
};
let jar = request_to_jar(request);
if jar
.private(&data.cookies_key)
.get("auth")
.map_or(true, |x| x.value().to_lowercase() != cached_data.1)
{
log::warn!("Incorrect user");
return HttpResponse::BadRequest().body("Incorrect");