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

Inconsistent behavior for the @Get(""), @Post("") ... methods #48

Open
DevItaliya22 opened this issue Dec 24, 2024 · 1 comment
Open

Comments

@DevItaliya22
Copy link

Describe the bug
When the route is defined as @Post("/"), making a POST request to http://localhost:3000/post does not work (throws a 404 error). Only http://localhost:3000/post/ works.

To Reproduce
Steps to reproduce the behavior:

  1. Define a POST route with @Post("/") in the PostController.
  2. Start the server.
  3. Make a POST request to http://localhost:3000/post (throws a 404 error).
  4. Make a POST request to http://localhost:3000/post/ (works).

Expected behavior
The route should work for both http://localhost:3000/post and http://localhost:3000/post/ seamlessly.

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g., Windows 11]
  • Browser: [e.g., Postman]
  • Version: [e.g., v10.14]

Additional context
This issue is caused by the route handling logic not normalizing paths without trailing slashes. A fix could involve ensuring that both cases are treated equivalently.

@vinayak25
Copy link
Member

Hi @DevItaliya22 , thanks for reporting this. I will check it

@baraich baraich mentioned this issue Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants