Skip to content

[Bug]: "*" not matching a URL with double slashes "//" #8428

@harxki

Description

@harxki

What version of React Router are you using?

6.0.2

Steps to Reproduce

  1. Prepare an application that uses react router v6.
  2. prepare a Route with a path of *.
    { path: "/", element: <Home /> },
    { path: "*", element: <NotFound /> }
    
  3. access the url with multiple slashes, such as https://example.com//a

Expected Behavior

This is also happening with Remix.
When accessing https://remix.run//a, the behavior is unintended.
Presumably, the component specified by * should be rendrering even if an unintended url string is given.

Actual Behavior

An error occurs.
I think it's because matchRoutes returns null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions