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:
committed by
Sean McArthur
parent
a228486a85
commit
8b3c120684
@@ -165,7 +165,7 @@ impl Handler<Http> for Text {
|
||||
fn on_request(&mut self, req: Request<Http>) -> Next {
|
||||
use hyper::RequestUri;
|
||||
let path = match *req.uri() {
|
||||
RequestUri::AbsolutePath(ref p) => p,
|
||||
RequestUri::AbsolutePath { path: ref p, .. } => p,
|
||||
RequestUri::AbsoluteUri(ref url) => url.path(),
|
||||
// other 2 forms are for CONNECT and OPTIONS methods
|
||||
_ => ""
|
||||
@@ -299,7 +299,7 @@ impl Handler<Http> for Text {
|
||||
fn on_request(&mut self, req: Request<Http>) -> Next {
|
||||
use hyper::RequestUri;
|
||||
let path = match *req.uri() {
|
||||
RequestUri::AbsolutePath(ref p) => p,
|
||||
RequestUri::AbsolutePath { path: ref p, .. } => p,
|
||||
RequestUri::AbsoluteUri(ref url) => url.path(),
|
||||
_ => ""
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user