From c9c589c57587a95595421e6922c27d4ade862455 Mon Sep 17 00:00:00 2001 From: Josiah Glosson Date: Fri, 17 Jan 2025 11:13:56 -0600 Subject: [PATCH] Fix not being able to connect to local friends socket --- packages/app-lib/src/util/fetch.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/app-lib/src/util/fetch.rs b/packages/app-lib/src/util/fetch.rs index b82b2cc86..83dd02757 100644 --- a/packages/app-lib/src/util/fetch.rs +++ b/packages/app-lib/src/util/fetch.rs @@ -1,4 +1,6 @@ //! Functions for fetching infromation from the Internet +use super::io::{self, IOError}; +use crate::config::{MODRINTH_API_URL, MODRINTH_API_URL_V3}; use crate::event::emit::emit_loading; use crate::event::LoadingBarId; use bytes::Bytes; @@ -11,8 +13,6 @@ use std::time::{self}; use tokio::sync::Semaphore; use tokio::{fs::File, io::AsyncWriteExt}; -use super::io::{self, IOError}; - #[derive(Debug)] pub struct IoSemaphore(pub Semaphore); #[derive(Debug)] @@ -87,7 +87,8 @@ pub async fn fetch_advanced( .map(|x| &*x.0.to_lowercase() == "authorization") .unwrap_or(false) && (url.starts_with("https://cdn.modrinth.com") - || url.starts_with("https://api.modrinth.com")) + || url.starts_with(MODRINTH_API_URL) + || url.starts_with(MODRINTH_API_URL_V3)) { crate::state::ModrinthCredentials::get_active(exec).await? } else {