mirror of
https://github.com/actix/actix-website
synced 2025-06-27 15:39:02 +02:00
Remove invalid docs regarding parsing PathBuf
(#230)
This paragraph is no longer valid since v1.0! Also, the example code still compiles fine and this may easily introduce a security vulnerability for the user.
This commit is contained in:
committed by
GitHub
parent
63d70701e0
commit
09ad5775ac
@ -7,7 +7,6 @@ pub mod norm;
|
||||
pub mod norm2;
|
||||
pub mod path;
|
||||
pub mod path2;
|
||||
pub mod pbuf;
|
||||
pub mod resource;
|
||||
pub mod scope;
|
||||
pub mod url_ext;
|
||||
|
@ -1,18 +0,0 @@
|
||||
// <pbuf>
|
||||
use actix_web::{get, App, HttpRequest, HttpServer, Result};
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[get("/a/{tail:.*}")]
|
||||
async fn index(req: HttpRequest) -> Result<String> {
|
||||
let path: PathBuf = req.match_info().query("tail").parse().unwrap();
|
||||
Ok(format!("Path {:?}", path))
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
HttpServer::new(|| App::new().service(index))
|
||||
.bind("127.0.0.1:8080")?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
// </pbuf>
|
Reference in New Issue
Block a user