Skip to content

Wild card routing for some specific URL not working #49034

@shubham2924

Description

@shubham2924

Which @angular/* package(s) are the source of the bug?

router

Is this a regression?

Yes

Description

This issue is intended for a special route edge case, citing official documentation for the same.

So I've developed an app with angular and used inbuilt routing provided by angular. Let me narrate the scenario:
There are various routes in the application in which wild card routing is added at the very end to show desired not-found component page. So URLs are like

https://mysite/api/books
https://mysite/api/users

etc...

so if there is an invalid URLs such as https://mysite/api/87*hfaabooks, then not-found component shown correctly as I've added { path: '**', component: <not-found-component>, pathMatch: 'full' } in the array of routes in appRoutingModule. But when an URL is like https://mysite/65%^dfhapi/books , we can observe invalid characters aren't added in the very last route instead with api word in the URL, so in this case it is redirecting to home page but as the URL is still invalid I want user to navigate to not-found-component.

Would like to if I'm missing anything, thanks in advance.
-Shubham

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

No response

Please provide the environment you discovered this bug in (run ng version)

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions