From 0d96b87f6f9074c78c6400c3d81f8e1008a3f6a4 Mon Sep 17 00:00:00 2001 From: intellild Date: Thu, 5 Jul 2018 19:22:44 +0800 Subject: [PATCH] fix request handler --- src/application.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/application.rs b/src/application.rs index 1c7f673..f68ca47 100644 --- a/src/application.rs +++ b/src/application.rs @@ -126,7 +126,8 @@ where type Result = AsyncResult; fn handle(&mut self, req: HttpRequest) -> AsyncResult { - let idx = if let Some(path) = req.match_info().get("tail") { + let idx = if let Some(full_path) = req.match_info().get("tail") { + let path = full_path.get(1..).unwrap_or(""); if path.is_empty() { return HttpResponse::Ok() .content_type("text/plain; charset=UTF-8")