Warp: Add filter to get a safe PathBuf

Created on 27 Jan 2020  路  1Comment  路  Source: seanmonstar/warp

The warp::fs filters currently decode the path tail into a safe PathBuf. It'd be useful to expose that by itself so others can use it while combining their own file filters.

Something like warp::fs::path_buf() could work.

feature

Most helpful comment

There is a lot of valuable code in warp::fs. I would really like a warp::reply::file(...) function or similar, that would essentially correspond to the private warp::filter::fs::file_reply() function. Also, it would maybe help with #526, if the warp::fs code would be more modular and more public. I tried to refactor it a bit, but my Rust/Async/Tokio skills are currently not up to this task.

>All comments

There is a lot of valuable code in warp::fs. I would really like a warp::reply::file(...) function or similar, that would essentially correspond to the private warp::filter::fs::file_reply() function. Also, it would maybe help with #526, if the warp::fs code would be more modular and more public. I tried to refactor it a bit, but my Rust/Async/Tokio skills are currently not up to this task.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kitsuneninetails picture kitsuneninetails  路  4Comments

silvioprog picture silvioprog  路  3Comments

dpc picture dpc  路  7Comments

whitfin picture whitfin  路  3Comments

seanmonstar picture seanmonstar  路  3Comments