diff options
| author | Fuwn <[email protected]> | 2025-07-08 05:15:47 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-07-08 05:15:47 +0000 |
| commit | 22299ccd501324fc348788c65e67e2080c705547 (patch) | |
| tree | f047076b73899f793cd92a2a56830f1a790b0013 /examples/fix_path.rs | |
| parent | refactor(router): Smarter trailing slash clipper (diff) | |
| download | windmark-22299ccd501324fc348788c65e67e2080c705547.tar.xz windmark-22299ccd501324fc348788c65e67e2080c705547.zip | |
feat(router): Add missing trailing slash corrector
Diffstat (limited to 'examples/fix_path.rs')
| -rw-r--r-- | examples/fix_path.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/fix_path.rs b/examples/fix_path.rs index e92376c..95761ea 100644 --- a/examples/fix_path.rs +++ b/examples/fix_path.rs @@ -22,7 +22,10 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { windmark::router::Router::new() .set_private_key_file("windmark_private.pem") .set_certificate_file("windmark_public.pem") - .add_options(&[windmark::router_option::RouterOption::TrimTrailingSlashes]) + .add_options(&[ + windmark::router_option::RouterOption::TrimTrailingSlashes, + windmark::router_option::RouterOption::AddMissingTrailingSlash, + ]) .mount( "/close", windmark::success!("Visit '/close/'; you should be close enough!"), |