aboutsummaryrefslogtreecommitdiff
path: root/src/url.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/url.rs')
-rw-r--r--src/url.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/url.rs b/src/url.rs
index 1e29e85..8c6dd9c 100644
--- a/src/url.rs
+++ b/src/url.rs
@@ -22,6 +22,7 @@ pub fn make(
path: &str,
fallback: bool,
is_proxy: &mut bool,
+ is_raw: &mut bool,
) -> Result<Url, gmi::url::UrlParseError> {
Ok(
match Url::try_from(&*if path.starts_with("/proxy") {
@@ -40,6 +41,15 @@ pub fn make(
path.replace("/x/", ""),
if fallback { "/" } else { "" }
)
+ } else if path.starts_with("/raw") {
+ *is_proxy = true;
+ *is_raw = true;
+
+ format!(
+ "gemini://{}{}",
+ path.replace("/raw/", ""),
+ if fallback { "/" } else { "" }
+ )
} else {
// Try to set `ROOT` as `ROOT` environment variable, or use
// `"gemini://fuwn.me"` as default.