♻️ Simple & Efficient Gemini-to-HTTP Proxy fuwn.net
proxy gemini-protocol protocol gemini http rust
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(response): handle non-trimmed redirect assumptions

Fuwn 6374a5f6 fc1323a3

+16 -5
+1 -1
Cargo.lock
··· 1839 1839 1840 1840 [[package]] 1841 1841 name = "september" 1842 - version = "0.2.25" 1842 + version = "0.2.26" 1843 1843 dependencies = [ 1844 1844 "actix-web", 1845 1845 "anyhow",
+1 -1
Cargo.toml
··· 2 2 3 3 [package] 4 4 name = "september" 5 - version = "0.2.25" 5 + version = "0.2.26" 6 6 authors = ["Fuwn <contact@fuwn.me>"] 7 7 edition = "2021" 8 8 description = "A simple and efficient Gemini-to-HTTP proxy."
+14 -3
src/response.rs
··· 58 58 } 59 59 }; 60 60 61 - if response.content().is_none() { 61 + if response.content().is_none() 62 + && response.status() != &germ::request::Status::PermanentRedirect 63 + && response.status() != &germ::request::Status::TemporaryRedirect 64 + { 62 65 response = match germ::request::request(&match url_from_path( 63 66 req.path().trim_end_matches('/'), 64 67 true, ··· 211 214 )); 212 215 213 216 let redirect_url = match url_from_path( 214 - response.meta().trim_end_matches('/'), 215 - true, 217 + &if response.meta().trim_end_matches('/').starts_with('/') { 218 + format!( 219 + "/proxy/{}{}", 220 + url.domain().unwrap_or_default(), 221 + response.meta().trim_end_matches('/') 222 + ) 223 + } else { 224 + response.meta().trim_end_matches('/').to_string() 225 + }, 226 + false, 216 227 &mut is_proxy, 217 228 &mut is_raw, 218 229 &mut is_nocss,