aboutsummaryrefslogtreecommitdiffstats
path: root/src/commands/web.rs
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-11-04 01:11:29 +0100
committersalmonik <salmonik@tuta.io>2026-11-04 01:11:29 +0100
commit81c19a8a4f1c99f721d4c65fbcddcec6474b752b (patch)
tree3b2320a40725420ef18669a15b1aa41e637e86c6 /src/commands/web.rs
parenttts: bound the audio cache and request length (diff)
downloadsenator-sperma-81c19a8a4f1c99f721d4c65fbcddcec6474b752b.tar.gz
senator-sperma-81c19a8a4f1c99f721d4c65fbcddcec6474b752b.zip
http: add connect and request timeouts
Diffstat (limited to '')
-rw-r--r--src/commands/web.rs3
1 files changed, 3 insertions, 0 deletions
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 @@
1use std::time::Duration;
2
1use poise::serenity_prelude as serenity; 3use poise::serenity_prelude as serenity;
2use scraper::{Html, Selector}; 4use scraper::{Html, Selector};
3 5
@@ -20,6 +22,7 @@ pub async fn web(ctx: Context<'_>, #[description = "Search query"] query: String
20 .data() 22 .data()
21 .http_client 23 .http_client
22 .get(&url) 24 .get(&url)
25 .timeout(Duration::from_secs(15))
23 .send() 26 .send()
24 .await? 27 .await?
25 .text() 28 .text()