aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorboastful-squirrel <boastful.squirrel@gmail.com>2019-05-02 05:18:03 +0000
committerboastful-squirrel <boastful.squirrel@gmail.com>2019-05-02 05:18:03 +0000
commitf5764b05970178db8504d6eeb857d082c81c291c (patch)
tree37fb23a4294e2f4f2fb2bad20da5e244a16bbef2 /src/main.rs
parentReturn to root when auth succeeds (diff)
downloadminiserve-f5764b05970178db8504d6eeb857d082c81c291c.tar.gz
miniserve-f5764b05970178db8504d6eeb857d082c81c291c.zip
Rename p404
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index 46f22c5..22b91cb 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -248,7 +248,7 @@ fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> {
u_r.clone(),
)
})
- .default_handler(p404),
+ .default_handler(error_404),
)
}
};
@@ -266,20 +266,20 @@ fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> {
})
// Handle directories
.handler(&full_route, s)
- .default_resource(|r| r.method(Method::GET).f(p404))
+ .default_resource(|r| r.method(Method::GET).f(error_404))
} else {
// Handle directories
app.handler(&full_route, s)
- .default_resource(|r| r.method(Method::GET).f(p404))
+ .default_resource(|r| r.method(Method::GET).f(error_404))
}
} else {
// Handle single files
app.resource(&full_route, |r| r.f(listing::file_handler))
- .default_resource(|r| r.method(Method::GET).f(p404))
+ .default_resource(|r| r.method(Method::GET).f(error_404))
}
}
-fn p404(req: &HttpRequest<crate::MiniserveConfig>) -> Result<HttpResponse, io::Error> {
+fn error_404(req: &HttpRequest<crate::MiniserveConfig>) -> Result<HttpResponse, io::Error> {
let err_404 = ContextualError::RouteNotFoundError(req.uri().to_string());
let default_color_scheme = req.state().default_color_scheme;
let return_address = match &req.state().random_route {