diff options
Diffstat (limited to 'src/url.rs')
| -rw-r--r-- | src/url.rs | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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. |