Warp: Tail() call crashes to expect

Created on 26 Feb 2020  路  2Comments  路  Source: seanmonstar/warp

When configuring redirect with tail(), it crashes from time to time to .expect("server URIs should always have path_and_query") with Warp 0.1.x. It could be because someone accesses it with CONNECT foo.bar. See #429 for discussion.

bug

Most helpful comment

It looks like this occurs in 0.2.x as well.

Simple test case:

let filter = warp::path::tail();

let _tail = warp::test::request()
    .path("localhost")
    .filter(&filter)
    .await
    .unwrap();

All 2 comments

This can be worked around by not using tail() when doing redirect. E.g. use any and map it to static URI.

It looks like this occurs in 0.2.x as well.

Simple test case:

let filter = warp::path::tail();

let _tail = warp::test::request()
    .path("localhost")
    .filter(&filter)
    .await
    .unwrap();
Was this page helpful?
0 / 5 - 0 ratings

Related issues

asaaki picture asaaki  路  7Comments

weiznich picture weiznich  路  7Comments

seanmonstar picture seanmonstar  路  3Comments

richardanaya picture richardanaya  路  6Comments

alexreg picture alexreg  路  7Comments