feat(server): add path() and query() to Request

Closes #896 
Closes #897

BREAKING CHANGE: `RequestUri::AbsolutePath` variant is changed to a struct variant. Consider using `req.path()` or `req.query()` to get the relevant slice.
This commit is contained in:
Ahmed Charles
2016-08-29 13:45:38 -07:00
committed by Sean McArthur
parent a228486a85
commit 8b3c120684
6 changed files with 63 additions and 24 deletions

View File

@@ -45,7 +45,7 @@ impl Echo {
impl Handler<HttpStream> for Echo {
fn on_request(&mut self, req: Request<HttpStream>) -> Next {
match *req.uri() {
RequestUri::AbsolutePath(ref path) => match (req.method(), &path[..]) {
RequestUri::AbsolutePath { ref path, .. } => match (req.method(), &path[..]) {
(&Get, "/") | (&Get, "/echo") => {
info!("GET Index");
self.route = Route::Index;