Don't try to handle fragment in router.
It is strictly a client-side mechanism
This commit is contained in:
parent
cdcdf8e72f
commit
b21a7ccda4
3 changed files with 3 additions and 3 deletions
|
@ -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::*;
|
||||
|
|
|
@ -5,5 +5,5 @@ pub trait Lookup {
|
|||
type Error;
|
||||
type Future: futures::Future<Item=Option<Self::Resource>, 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;
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ impl Lookup for WikiLookup {
|
|||
type Error = Box<::std::error::Error + Send + Sync>;
|
||||
type Future = Box<Future<Item = Option<Self::Resource>, 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("/_") {
|
||||
|
|
Loading…
Reference in a new issue