♻️ 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.

style(response): clippy cleanup

Fuwn e071ba1e caeddebb

+10 -9
+10 -9
src/response.rs
··· 8 8 9 9 const CSS: &str = include_str!("../default.css"); 10 10 11 - #[allow(clippy::unused_async, clippy::future_not_send, clippy::too_many_lines)] 11 + #[allow(clippy::future_not_send, clippy::too_many_lines)] 12 12 pub async fn default( 13 - req: actix_web::HttpRequest, 13 + http_request: actix_web::HttpRequest, 14 14 ) -> Result<HttpResponse, Error> { 15 15 if ["/proxy", "/proxy/", "/x", "/x/", "/raw", "/raw/", "/nocss", "/nocss/"] 16 - .contains(&req.path()) 16 + .contains(&http_request.path()) 17 17 { 18 18 return Ok( 19 19 HttpResponse::Ok() ··· 26 26 27 27 let mut configuration = configuration::Configuration::new(); 28 28 let url = match url_from_path( 29 - &format!("{}{}", req.path(), { 30 - if !req.query_string().is_empty() || req.uri().to_string().ends_with('?') 29 + &format!("{}{}", http_request.path(), { 30 + if !http_request.query_string().is_empty() 31 + || http_request.uri().to_string().ends_with('?') 31 32 { 32 - format!("?{}", req.query_string()) 33 + format!("?{}", http_request.query_string()) 33 34 } else { 34 35 String::new() 35 36 } ··· 175 176 html_context.push_str(&format!("<title>{gemini_title}</title>")); 176 177 html_context.push_str("</head><body>"); 177 178 178 - if !req.path().starts_with("/proxy") { 179 + if !http_request.path().starts_with("/proxy") { 179 180 if let Ok(header) = var("HEADER") { 180 181 html_context 181 182 .push_str(&format!("<big><blockquote>{header}</blockquote></big>")); ··· 236 237 237 238 if let Ok(plain_texts) = var("PLAIN_TEXT_ROUTE") { 238 239 if plain_texts.split(',').any(|r| { 239 - path_matches_pattern(r, req.path()) 240 - || path_matches_pattern(r, req.path().trim_end_matches('/')) 240 + path_matches_pattern(r, http_request.path()) 241 + || path_matches_pattern(r, http_request.path().trim_end_matches('/')) 241 242 }) { 242 243 return Ok(HttpResponse::Ok().body( 243 244 response.content().as_ref().map_or_else(String::default, String::clone),