-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Method 'HEAD' already declared for route - regression in 4.24.0 #5089
Comments
I believe it's working correctly now You need to set |
The following fixes the error: app.route({
method: 'GET',
url: '/proxy/*',
exposeHeadRoute: false,
...
}) |
If you invert the order of definitions you should be able to unpin it. |
Anyway it looks like a bug. From the code I see, fastify should remove a default |
There is another small bug in the fastify. |
Thanks all for the fast responses. I can confirm that setting |
It actually is the best choice. |
Nvm, see now what’s happening 😓 |
I found the problem. Working on it. |
Prerequisites
Fastify version
4.24.0
Plugin version
No response
Node.js version
16.20
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
latest
Description
With the 4.24.0 release, our application no longer starts due to an error:
Our application makes two calls to
app.route
- the first handles GET requests that could be a WebSocket connection, the second handles all the other methods we need to cope with.With 4.24.0, this second call is triggering the error. Previous versions worked fine.
Steps to Reproduce
I will update with a link to a repo containing as minimal reproduction as I can create tomorrow.
I wanted to get the issue recorded quickly as it appears to be a regression in 4.24.0. Looking at PRs in the release, #5078 appears very relevant.
Expected Behavior
No response
The text was updated successfully, but these errors were encountered: