diff options
| author | Fuwn <[email protected]> | 2024-03-26 05:22:03 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-03-26 05:22:03 +0000 |
| commit | 08407e4389852cc223d61575caf286cbd437124a (patch) | |
| tree | 09f9a77a82b3d5ccc8d429731b06df8c4e0f9be3 | |
| parent | feat(response): support redirects (diff) | |
| download | september-08407e4389852cc223d61575caf286cbd437124a.tar.xz september-08407e4389852cc223d61575caf286cbd437124a.zip | |
refactor(url): rename make
| -rw-r--r-- | src/response.rs | 6 | ||||
| -rw-r--r-- | src/url.rs | 2 |
2 files changed, 4 insertions, 4 deletions
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, @@ -17,7 +17,7 @@ use url::Url; -pub fn make( +pub fn from_path( path: &str, fallback: bool, is_proxy: &mut bool, |