From 3ccfa96a3c6faba091c7bdc6c18250a30b85d0b9 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 20 Apr 2022 23:57:42 +0000 Subject: fix(proxy): pass query --- src/main.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index bf566a2..795127e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -276,7 +276,19 @@ fn make_url( async fn default(req: actix_web::HttpRequest) -> Result { let mut is_proxy = false; // Try to construct a Gemini URL - let url = make_url(req.path(), false, &mut is_proxy).unwrap(); + let url = make_url( + &format!("{}{}", req.path(), { + if !req.query_string().is_empty() || req.uri().to_string().ends_with('?') + { + format!("?{}", req.query_string()) + } else { + "".to_string() + } + }), + false, + &mut is_proxy, + ) + .unwrap(); // Make a request to get Gemini content and time it. let mut timer = Instant::now(); let mut response = match gmi::request::make_request(&url) { -- cgit v1.2.3