Skip to content

Commit f884167

Browse files
authored
Merge pull request #537 from http-rs/no-self-in-return
Update Request to latest http-types
2 parents 27310f9 + c4d4732 commit f884167

11 files changed

+169
-93
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async-h1 = { version = "2.0.0", optional = true }
3636
async-sse = "2.1.0"
3737
async-std = { version = "1.6.0", features = ["unstable"] }
3838
femme = "2.0.1"
39-
http-types = "2.0.0"
39+
http-types = "2.0.1"
4040
kv-log-macro = "1.0.4"
4141
mime = "0.3.14"
4242
mime_guess = "2.0.3"

src/cookies/middleware.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl<State: Send + Sync + 'static> Middleware<State> for CookiesMiddleware {
4545
let cookie_data = CookieData::from_request(&ctx);
4646
// no cookie data in ext context, so we try to create it
4747
let content = cookie_data.content.clone();
48-
ctx = ctx.set_ext(cookie_data);
48+
ctx.set_ext(cookie_data);
4949
content
5050
};
5151

src/fs/serve_dir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl ServeDir {
2222

2323
impl<State> Endpoint<State> for ServeDir {
2424
fn call<'a>(&'a self, req: Request<State>) -> BoxFuture<'a, Result> {
25-
let path = req.uri().path();
25+
let path = req.url().path();
2626
let path = path.trim_start_matches(&self.prefix);
2727
let path = path.trim_start_matches('/');
2828
let mut file_path = self.dir.clone();

src/log/middleware.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl LogMiddleware {
3030
ctx: Request<State>,
3131
next: Next<'a, State>,
3232
) -> crate::Result {
33-
let path = ctx.uri().path().to_owned();
33+
let path = ctx.url().path().to_owned();
3434
let method = ctx.method().to_string();
3535
log::info!("<-- Request received", {
3636
method: method,

0 commit comments

Comments
 (0)