diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2021-03-20 22:02:24 +0000 |
---|---|---|
committer | Sven-Hendrik Haase <svenstaro@gmail.com> | 2021-03-20 22:02:24 +0000 |
commit | 00dc0a3be54085164ba960b72393d13abf40223f (patch) | |
tree | ae2f219455d51c8440a3d1071b71606c82e30bda | |
parent | Add option to show hidden files (diff) | |
download | miniserve-00dc0a3be54085164ba960b72393d13abf40223f.tar.gz miniserve-00dc0a3be54085164ba960b72393d13abf40223f.zip |
Finish up --hidden feature
Diffstat (limited to '')
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | tests/fixtures/mod.rs | 2 | ||||
-rw-r--r-- | tests/serve_request.rs | 9 |
3 files changed, 4 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 392c946..639cd81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). <!-- next-header --> ## [Unreleased] - ReleaseDate +- Add option `-H`/`--hidden` to show hidden files - Start instantly in case an explicit index is chosen - Fix DoS issue when deliberately sending unconforming URL paths - Add footer [#456](https://github.com/svenstaro/miniserve/pull/456) (thanks @levaitamas) diff --git a/tests/fixtures/mod.rs b/tests/fixtures/mod.rs index 84517e5..7efbe5e 100644 --- a/tests/fixtures/mod.rs +++ b/tests/fixtures/mod.rs @@ -28,7 +28,7 @@ pub static DIRECTORIES: &[&str] = &["dira/", "dirb/", "dirc/"]; /// Hidden directories for testing purpose #[allow(dead_code)] -pub static HIDDEN_DIRECTORIES: &[&str] = &[".hidden_dir1", ".hidden_dir2"]; +pub static HIDDEN_DIRECTORIES: &[&str] = &[".hidden_dir1/", ".hidden_dir2/"]; /// Name of a deeply nested file #[allow(dead_code)] diff --git a/tests/serve_request.rs b/tests/serve_request.rs index 8403a39..7201e26 100644 --- a/tests/serve_request.rs +++ b/tests/serve_request.rs @@ -88,13 +88,8 @@ fn serves_requests_hidden_files(tmpdir: TempDir, port: u16) -> Result<(), Error> sleep(Duration::from_secs(1)); - let paths = std::fs::read_dir(tmpdir.path()).unwrap(); - - for path in paths { - println!("Name: {}", path.unwrap().path().display()) - } - - let body = reqwest::blocking::get("http://localhost:8080")?.error_for_status()?; + let body = reqwest::blocking::get(format!("http://localhost:{}", port).as_str())? + .error_for_status()?; let parsed = Document::from_read(body)?; for &file in FILES.into_iter().chain(HIDDEN_FILES) { |