From 08407e4389852cc223d61575caf286cbd437124a Mon Sep 17 00:00:00 2001 From: Fuwn Date: Tue, 26 Mar 2024 05:22:03 +0000 Subject: refactor(url): rename make --- src/response.rs | 6 +++--- src/url.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/response.rs b/src/response.rs index 717da4c..a6817a2 100644 --- a/src/response.rs +++ b/src/response.rs @@ -16,7 +16,7 @@ // SPDX-License-Identifier: GPL-3.0-only use { - crate::url::make as make_url, + crate::url::from_path as url_from_path, actix_web::{Error, HttpResponse}, std::{env::var, time::Instant}, }; @@ -43,7 +43,7 @@ For example: to proxy "gemini://fuwn.me/uptime", visit "/proxy/fuwn.me/uptime".< let mut is_raw = false; let mut is_nocss = false; // Try to construct a Gemini URL - let url = match make_url( + let url = match url_from_path( &format!("{}{}", req.path(), { if !req.query_string().is_empty() || req.uri().to_string().ends_with('?') { @@ -76,7 +76,7 @@ For example: to proxy "gemini://fuwn.me/uptime", visit "/proxy/fuwn.me/uptime".< }; if response.content().is_some() { - response = match germ::request::request(&match make_url( + response = match germ::request::request(&match url_from_path( req.path().trim_end_matches('/'), true, &mut is_proxy, diff --git a/src/url.rs b/src/url.rs index 8f510aa..e004696 100644 --- a/src/url.rs +++ b/src/url.rs @@ -17,7 +17,7 @@ use url::Url; -pub fn make( +pub fn from_path( path: &str, fallback: bool, is_proxy: &mut bool, -- cgit v1.2.3