Skip to content

Commit 4e64b47

Browse files
committed
perf(server): use disable_indexing() from utils instead of raw get_setting
1 parent 3dedcb5 commit 4e64b47

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/server.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use std::{
2828
use time::OffsetDateTime;
2929
use tokio::net::TcpListener;
3030

31-
use crate::{config, dbg_msg};
31+
use crate::dbg_msg;
3232

3333
/// The unified body type used for all responses.
3434
pub type Body = BoxBody<Bytes, Infallible>;
@@ -373,10 +373,7 @@ impl Server {
373373
let def_headers = (*default_headers).clone();
374374

375375
// Catch robots.txt-disrespectful bots who still identify themselves
376-
if match config::get_setting("REDLIB_ROBOTS_DISABLE_INDEXING") {
377-
Some(val) => val == "on",
378-
None => false,
379-
} {
376+
if crate::utils::disable_indexing() {
380377
if let Some(user_agent) = req_headers.get("user-agent") {
381378
if let Ok(user_agent_str) = user_agent.to_str() {
382379
for banned in BANNED_USER_AGENTS {

0 commit comments

Comments
 (0)