Hide NSFW content by default

This commit is contained in:
spikecodes 2021-01-30 21:43:46 -08:00
parent 79027c4c75
commit 1653d4fb4c
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB
7 changed files with 12 additions and 12 deletions

View file

@ -33,7 +33,7 @@ struct SearchTemplate {
// SERVICES
pub async fn find(req: HttpRequest) -> HttpResponse {
let nsfw_results = if cookie(&req, "hide_nsfw") != "on" { "&include_over_18=on" } else { "" };
let nsfw_results = if cookie(&req, "show_nsfw") == "on" { "&include_over_18=on" } else { "" };
let path = format!("{}.json?{}{}", req.path(), req.query_string(), nsfw_results);
let sub = req.match_info().get("sub").unwrap_or("").to_string();