Merge branch 'rolling' into FIX/463_results_from_different_search_engines_get_cached_as_the_same_key

This commit is contained in:
neon_arch 2024-01-02 12:29:54 +03:00 committed by GitHub
commit 36e2ac93be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 206 additions and 77 deletions

View file

@ -11,7 +11,7 @@ use crate::{
},
results::aggregator::aggregate,
};
use actix_web::{get, web, HttpRequest, HttpResponse};
use actix_web::{get, http::header::ContentType, web, HttpRequest, HttpResponse};
use regex::Regex;
use std::{
fs::File,
@ -68,18 +68,16 @@ pub async fn search(
get_results(page + 1)
);
Ok(HttpResponse::Ok()
.content_type("text/html; charset=utf-8")
.body(
crate::templates::views::search::search(
&config.style.colorscheme,
&config.style.theme,
&config.style.animation,
query,
&results?,
)
.0,
))
Ok(HttpResponse::Ok().content_type(ContentType::html()).body(
crate::templates::views::search::search(
&config.style.colorscheme,
&config.style.theme,
&config.style.animation,
query,
&results?,
)
.0,
))
}
None => Ok(HttpResponse::TemporaryRedirect()
.insert_header(("location", "/"))