From b21a7ccda4bfdaf626c474788ec8cef72cee63dc Mon Sep 17 00:00:00 2001 From: Magnus Hoff Date: Mon, 2 Oct 2017 21:35:52 +0200 Subject: [PATCH] Don't try to handle fragment in router. It is strictly a client-side mechanism --- src/site.rs | 2 +- src/web/lookup.rs | 2 +- src/wiki_lookup.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/site.rs b/src/site.rs index 18ea3e1..bae3375 100644 --- a/src/site.rs +++ b/src/site.rs @@ -77,7 +77,7 @@ impl Service for Site { let (method, uri, _http_version, _headers, body) = req.deconstruct(); println!("{} {}", method, uri); - Box::new(self.root.lookup(uri.path(), uri.query(), None /*uri.fragment()*/) + Box::new(self.root.lookup(uri.path(), uri.query()) .and_then(move |resource| match resource { Some(resource) => { use hyper::Method::*; diff --git a/src/web/lookup.rs b/src/web/lookup.rs index 4920ba5..8fffeff 100644 --- a/src/web/lookup.rs +++ b/src/web/lookup.rs @@ -5,5 +5,5 @@ pub trait Lookup { type Error; type Future: futures::Future, Error=Self::Error>; - fn lookup(&self, path: &str, query: Option<&str>, fragment: Option<&str>) -> Self::Future; + fn lookup(&self, path: &str, query: Option<&str>) -> Self::Future; } diff --git a/src/wiki_lookup.rs b/src/wiki_lookup.rs index bceb8f7..56fe7ee 100644 --- a/src/wiki_lookup.rs +++ b/src/wiki_lookup.rs @@ -59,7 +59,7 @@ impl Lookup for WikiLookup { type Error = Box<::std::error::Error + Send + Sync>; type Future = Box, Error = Self::Error>>; - fn lookup(&self, path: &str, query: Option<&str>, _fragment: Option<&str>) -> Self::Future { + fn lookup(&self, path: &str, query: Option<&str>) -> Self::Future { assert!(path.starts_with("/")); if path.starts_with("/_") {