Skip to content

Commit

Permalink
Adjust from feedback
Browse files Browse the repository at this point in the history
- remove info logging
- add comment to clarify logic
  • Loading branch information
nlopes committed Aug 7, 2023
1 parent 1fd6060 commit 9a24cfd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,13 @@ fn configure_app(app: &mut web::ServiceConfig, conf: &MiniserveConfig) {
}
}

// Handle --pretty-urls options.
//
// We rewrite the request to append ".html" to the path and serve the file. If the
// path ends with a `/`, we remove it before appending ".html".
//
// This is done to allow for pretty URLs, e.g. "/about" instead of "/about.html".
if conf.pretty_urls {
log::info!("Pretty URLs enabled.");
files = files.default_handler(fn_service(|req: ServiceRequest| async {
let (req, _) = req.into_parts();
let conf = req
Expand Down

0 comments on commit 9a24cfd

Please sign in to comment.