From bcc686c84cbcae831aeacc3c9e17b8eaf495353a Mon Sep 17 00:00:00 2001 From: Till Hoeppner Date: Tue, 12 May 2015 17:17:04 +0200 Subject: Fix for hyperium/hyper#368 --- src/sersve.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/sersve.rs b/src/sersve.rs index dc5f717..1ed1129 100644 --- a/src/sersve.rs +++ b/src/sersve.rs @@ -236,6 +236,8 @@ fn from_path(path: &Path) -> IronResult { } fn serve(req: &mut Request) -> IronResult { + req.headers.set_raw("Connection", vec![b"close".to_vec()]); + let (filter_str, max_size) = ( ARGS.flag_filter.clone(), ARGS.flag_size @@ -277,7 +279,7 @@ fn serve(req: &mut Request) -> IronResult { } else { let mut content: Vec = match fs::read_dir(&path) { Ok(s) => s.filter_map(Result::ok).map(|s| s.path()).collect(), - Err(e) => return html(e.description().as_bytes()) + Err(e) => return html(format!("Error: {}", e.description()).as_bytes()) }; content.sort_by(|a, b| a.to_string_lossy().cmp(&b.to_string_lossy())); let mut out = Vec::with_capacity(DEF_LEN); -- cgit v1.2.3