Skip to content

CatchAll(/*) don't works #64

@taikulawo

Description

@taikulawo

Hi. I need a catch all route /*, but I don't care params.

#[test]
    fn test_route_path_match() {
        let mut router = Router::new();
        // works
        router.insert("/{*p}", "Catch All Workaround").unwrap();
        let matched = router.at("/endpoints/foo/bar").unwrap();
        assert_eq!(*matched.value, "Catch All Workaround");
        // panic
        let mut router = Router::new();
        router.insert("/*", "Catch All").unwrap();
        let matched = router.at("/endpoints/foo/bar").unwrap();
        assert_eq!(*matched.value, "Catch All");
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions