diff options
| author | Fuwn <[email protected]> | 2022-04-20 23:57:42 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2022-04-20 23:57:42 +0000 |
| commit | 3ccfa96a3c6faba091c7bdc6c18250a30b85d0b9 (patch) | |
| tree | 3cea3988b83f16884da35a946766b70c260c6e86 /src | |
| parent | ci(docker): use locus' dockerfile (diff) | |
| download | september-3ccfa96a3c6faba091c7bdc6c18250a30b85d0b9.tar.xz september-3ccfa96a3c6faba091c7bdc6c18250a30b85d0b9.zip | |
fix(proxy): pass query
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 14 |
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) { |