aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.rs14
1 files changed, 13 insertions, 1 deletions
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<HttpResponse, Error> {
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) {