Introduce splitting on /-es in URLs
This commit is contained in:
parent
573195d09c
commit
16efa068d8
1 changed files with 9 additions and 1 deletions
|
@ -60,7 +60,15 @@ impl Lookup for WikiLookup {
|
||||||
).boxed();
|
).boxed();
|
||||||
}
|
}
|
||||||
|
|
||||||
let slug = &path[1..];
|
let mut split = path[1..].split('/');
|
||||||
|
|
||||||
|
let slug = split.next().expect("Always at least one element");
|
||||||
|
|
||||||
|
if split.next() != None {
|
||||||
|
// Currently disallow any URLs of the form /slug/...
|
||||||
|
return futures::finished(None).boxed();
|
||||||
|
}
|
||||||
|
|
||||||
if let Ok(article_id) = slug.parse() {
|
if let Ok(article_id) = slug.parse() {
|
||||||
let state = self.state.clone();
|
let state = self.state.clone();
|
||||||
self.state.get_article_revision_by_id(article_id)
|
self.state.get_article_revision_by_id(article_id)
|
||||||
|
|
Loading…
Reference in a new issue