Moved to PSQL.
Build and Publish / Build and Publish Docker Image (push) Successful in 1m42s

This commit is contained in:
ab
2026-07-11 14:11:31 +03:00
parent 91ca486e64
commit 1bd3e17672
13 changed files with 483 additions and 748 deletions
+8 -14
View File
@@ -343,22 +343,14 @@ async fn submit_feedback(
serde_html_form::from_bytes(&bytes).map_err(|e| cot::Error::internal(e.to_string()))?;
if !crate::turnstile::verify(&db, form.cf_turnstile_response.as_deref()).await? {
return Redirect::new(format!(
"/client/{}?lang={}",
token_clone,
lang.code()
))
.into_response();
return Redirect::new(format!("/client/{}?lang={}", token_clone, lang.code()))
.into_response();
}
if let Some(mut visit) = query!(Visit, $id == visit_id).get(&db).await? {
if visit.status == "deleted" {
return Redirect::new(format!(
"/client/{}?lang={}",
token_clone,
lang.code()
))
.into_response();
return Redirect::new(format!("/client/{}?lang={}", token_clone, lang.code()))
.into_response();
}
if visit.client_id.primary_key().unwrap() == client_id {
visit.client_feedback = Some(form.feedback);
@@ -552,8 +544,10 @@ async fn sitemap_xml(_request: Request, db: Database) -> cot::Result<Response> {
domain = site_domain
);
let mut resp = Response::new(cot::Body::fixed(body.into_bytes()));
resp.headers_mut()
.insert("content-type", "application/xml; charset=utf-8".parse().unwrap());
resp.headers_mut().insert(
"content-type",
"application/xml; charset=utf-8".parse().unwrap(),
);
Ok(resp)
}