From 81c19a8a4f1c99f721d4c65fbcddcec6474b752b Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 01:11:29 +0100 Subject: http: add connect and request timeouts --- src/commands/web.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/commands') diff --git a/src/commands/web.rs b/src/commands/web.rs index d68f663..f8b8667 100644 --- a/src/commands/web.rs +++ b/src/commands/web.rs @@ -1,3 +1,5 @@ +use std::time::Duration; + use poise::serenity_prelude as serenity; use scraper::{Html, Selector}; @@ -20,6 +22,7 @@ pub async fn web(ctx: Context<'_>, #[description = "Search query"] query: String .data() .http_client .get(&url) + .timeout(Duration::from_secs(15)) .send() .await? .text() -- cgit v1.2.3