diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2021-08-29 01:41:24 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-29 01:41:24 +0000 |
commit | 78b64b5401baa1a46eb25358dd6c9208dc30bba0 (patch) | |
tree | a99016ed85909dc74c258bbe90155ed6f736cb82 /tests | |
parent | Add CHANGELOG entry for visited colors (diff) | |
parent | list directory if index not found (diff) | |
download | miniserve-78b64b5401baa1a46eb25358dd6c9208dc30bba0.tar.gz miniserve-78b64b5401baa1a46eb25358dd6c9208dc30bba0.zip |
Merge pull request #583 from aliemjay/index-fallback
list directory if index not found
Diffstat (limited to 'tests')
-rw-r--r-- | tests/serve_request.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/serve_request.rs b/tests/serve_request.rs index 361801b..09a20d4 100644 --- a/tests/serve_request.rs +++ b/tests/serve_request.rs @@ -220,3 +220,14 @@ fn serves_requests_custom_index_notice(tmpdir: TempDir, port: u16) -> Result<(), Ok(()) } + +#[rstest] +#[case(server(&["--index", FILES[0]]))] +#[case(server(&["--index", "does-not-exist.html"]))] +fn index_fallback_to_listing(#[case] server: TestServer) -> Result<(), Error> { + // If index file is not found, show directory listing instead. + // both cases should return `Ok` + reqwest::blocking::get(server.url())?.error_for_status()?; + + Ok(()) +} |