Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving "Error: Wildcard must be the last character in the route" #378

Open
Tayvon opened this issue Jul 18, 2024 · 4 comments
Open

Resolving "Error: Wildcard must be the last character in the route" #378

Tayvon opened this issue Jul 18, 2024 · 4 comments
Labels

Comments

@Tayvon
Copy link

Tayvon commented Jul 18, 2024

What's the recommended way of dealing with this error?

Example paths:

/^\/-\/all.*/
/(\/(.*)\.tgz)\/-rev\/(?:.*)/
@mcollina
Copy link
Collaborator

I would recommend you to check the readme. You can't specify routes as regexp directly.

In this sense, there is a bug: we should throw if we encounter one.

Checkout the readme.

@mcollina mcollina added the bug label Jul 18, 2024
@Tayvon
Copy link
Author

Tayvon commented Jul 18, 2024

Great, thank you.

@Tayvon
Copy link
Author

Tayvon commented Jul 18, 2024

After reading the README over a few times, i'm still unable to get past this error. I added in the allowUnsafeRegex option, and the previous behavior remains.

Are you suggesting that regexp cant be used unless it's form adheres to the few examples outlined in the README?

@Tayvon
Copy link
Author

Tayvon commented Jul 18, 2024

What's the intuition behind not allowing a wildcard to exist in a regexp unless it's at the end of the expression?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants