actix-web: URL parameters not being decoded.

I have a basic project using actix-web, with a route, accepting a URL parameter named url. When I call this route by requesting http://localhost:8080/%2F, the parameter is not decoded, and remains as “%2F” instead of “/”.

server::new(|| App::new().resource("/{url}", |r| r.with(process)))
    .bind("0.0.0.0:8080")
    .unwrap()
    .start();

// RETURNS "%2F" NOT "/"
let url = req.match_info()
    .get("url")
    .unwrap();

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (8 by maintainers)

Most upvoted comments

Having the same issue, would be good to get / and + decoded as text without changing the route.