diff options
author | boastful-squirrel <boastful.squirrel@gmail.com> | 2019-05-01 15:54:28 +0000 |
---|---|---|
committer | boastful-squirrel <boastful.squirrel@gmail.com> | 2019-05-01 15:54:28 +0000 |
commit | 506a95319c35c5d744ca29726bafe2bff1b70221 (patch) | |
tree | 8c72487bf989585aa2047d2c30f5bb74a8fe6c5d /src/auth.rs | |
parent | Added doc (diff) | |
download | miniserve-506a95319c35c5d744ca29726bafe2bff1b70221.tar.gz miniserve-506a95319c35c5d744ca29726bafe2bff1b70221.zip |
Fix return link when random_route is set
Diffstat (limited to 'src/auth.rs')
-rw-r--r-- | src/auth.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/auth.rs b/src/auth.rs index 23ea668..889498e 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -142,9 +142,14 @@ fn build_unauthorized_response( if log_error_chain { errors::log_error_chain(error.to_string()); } + let return_path = match &req.state().random_route { + Some(random_route) => format!("/{}", random_route), + None => req.path().to_string(), + }; + renderer::render_error( &error.to_string(), - req.path(), + &return_path, None, None, req.state().default_color_scheme, |