Skip to content

Commit

Permalink
Fix "serve" subcommand for URL encoded static files (#1351)
Browse files Browse the repository at this point in the history
  • Loading branch information
wdv4758h committed Feb 13, 2021
1 parent 3cb61c3 commit d734b17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async fn handle_request(req: Request<Body>, mut root: PathBuf) -> Result<Respons

// Remove the trailing slash from the request path
// otherwise `PathBuf` will interpret it as an absolute path
root.push(&req.uri().path()[1..]);
root.push(&decoded[1..]);
let result = tokio::fs::read(&root).await;

let contents = match result {
Expand Down

0 comments on commit d734b17

Please sign in to comment.