From d9d8c1f6d910ebf3d7042957c363408db75c78d2 Mon Sep 17 00:00:00 2001 From: TC <93944281+tomconerlyanth@users.noreply.github.com> Date: Thu, 11 Jul 2024 21:30:45 +0200 Subject: [PATCH] assistant: Handle `http://` links in `/fetch` (#14243) Previously http://google.com would get modified to https://http://google.com which doesn't work. I assume http links should be supported. Release Notes: - N/A --- crates/assistant/src/slash_command/fetch_command.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/assistant/src/slash_command/fetch_command.rs b/crates/assistant/src/slash_command/fetch_command.rs index 547cacf55974dfefa9611d4199e7de8f52c1758a..c99bf438fbc20626a344dffc4b311aed212a742d 100644 --- a/crates/assistant/src/slash_command/fetch_command.rs +++ b/crates/assistant/src/slash_command/fetch_command.rs @@ -27,7 +27,7 @@ pub(crate) struct FetchSlashCommand; impl FetchSlashCommand { async fn build_message(http_client: Arc, url: &str) -> Result { let mut url = url.to_owned(); - if !url.starts_with("https://") { + if !url.starts_with("https://") && !url.starts_with("http://") { url = format!("https://{url}"); }