diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2023-03-01 02:38:23 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-01 02:38:23 +0000 |
commit | a93170d0e4cb80266da696b827e6ee21bacc5858 (patch) | |
tree | 74ec1263d385dd01107dd839fe0e73960ed24124 /src/listing.rs | |
parent | Merge pull request #1045 from svenstaro/dependabot/cargo/clap_mangen-0.2.9 (diff) | |
parent | Added tests and small fixes (diff) | |
download | miniserve-a93170d0e4cb80266da696b827e6ee21bacc5858.tar.gz miniserve-a93170d0e4cb80266da696b827e6ee21bacc5858.zip |
Merge pull request #1043 from Yusuto/wget-fix
Fix the wget footer
Diffstat (limited to 'src/listing.rs')
-rw-r--r-- | src/listing.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/listing.rs b/src/listing.rs index a62c969..e360368 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -163,12 +163,12 @@ pub fn directory_listing( let base = Path::new(serve_path); let random_route_abs = format!("/{}", conf.route_prefix); - let abs_url = format!( - "{}://{}{}", - req.connection_info().scheme(), - req.connection_info().host(), - req.uri() - ); + let abs_uri = http::Uri::builder() + .scheme(req.connection_info().scheme()) + .authority(req.connection_info().host()) + .path_and_query(req.uri().to_string()) + .build() + .unwrap(); let is_root = base.parent().is_none() || Path::new(&req.path()) == Path::new(&random_route_abs); let encoded_dir = match base.strip_prefix(random_route_abs) { @@ -379,7 +379,7 @@ pub fn directory_listing( renderer::page( entries, readme, - abs_url, + &abs_uri, is_root, query_params, &breadcrumbs, |