diff options
| author | Fuwn <[email protected]> | 2022-07-03 05:03:00 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-07-03 05:03:00 +0000 |
| commit | 9db0750df8b0eed28851cca4b880da2b8ee50bc7 (patch) | |
| tree | f1e4105c7ade0f4461becafe0fa82f7b03e6298b /src/url.rs | |
| parent | feat(response): url error handling (diff) | |
| download | september-9db0750df8b0eed28851cca4b880da2b8ee50bc7.tar.xz september-9db0750df8b0eed28851cca4b880da2b8ee50bc7.zip | |
feat(response): add nocss route
Diffstat (limited to 'src/url.rs')
| -rw-r--r-- | src/url.rs | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -23,6 +23,7 @@ pub fn make( fallback: bool, is_proxy: &mut bool, is_raw: &mut bool, + is_nocss: &mut bool, ) -> Result<Url, gmi::url::UrlParseError> { Ok( match Url::try_from(&*if path.starts_with("/proxy") { @@ -50,6 +51,15 @@ pub fn make( path.replace("/raw/", ""), if fallback { "/" } else { "" } ) + } else if path.starts_with("/nocss") { + *is_proxy = true; + *is_nocss = true; + + format!( + "gemini://{}{}", + path.replace("/nocss/", ""), + if fallback { "/" } else { "" } + ) } else { // Try to set `ROOT` as `ROOT` environment variable, or use // `"gemini://fuwn.me"` as default. |