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

[Bug]: Server doesn't handle periods in path parameters #11174

Open
1 task done
roberttod opened this issue Aug 8, 2024 · 1 comment
Open
1 task done

[Bug]: Server doesn't handle periods in path parameters #11174

roberttod opened this issue Aug 8, 2024 · 1 comment
Assignees
Labels
bug/needs-info More information is needed for reproduction

Comments

@roberttod
Copy link

roberttod commented Aug 8, 2024

What's not working?

This is linked to #9714 which fixes this issue for query parameters.

As discussed with @dthyresson , the Redwood dev server returns 404s when there is a . in a path parameter. E.g. the url http://localhost:8910/somepath/1.2/view would 404 even with a matching route. If you navigate to the route on the client, there is no error but reloading will make a request to the server.

This is not the case for production for a) a standard Netlify deployment or b) the recommended Heroku deployment with nginx. Instead, the static file server will always return index.html if there are no assets found to match the uri.

There are a few workarounds for this

  1. Let dev fail when you reload, and test by navigating to the URL you are working on
  2. Replace . with another character when writing and reading the url
  3. Put the . in a query parameter, which means you loose typing (and the URL is very long in my case)

It should be fairly simple and safe (noting the existing production functionality) to fix this by returning index.html instead of a 404.

How do we reproduce the bug?

Make any path with a String parameter in the router, and load a url with a . somewhere in the paramater.

What's your environment? (If it applies)

No response

Are you interested in working on this?

  • I'm interested in working on this
@roberttod roberttod added the bug/needs-info More information is needed for reproduction label Aug 8, 2024
@dthyresson
Copy link
Contributor

thanks @roberttod for writing up this issue from our conversations. I'll bring it to the rest of the team's attention.

@dthyresson dthyresson self-assigned this Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction
Projects
None yet
Development

No branches or pull requests

2 participants