uNetworking / uWebSockets.js

μWebSockets for Node.js back-ends :metal:
Apache License 2.0
8.1k stars 578 forks source link

`/*` doesn't work as expected as in previous versions #1001

Closed ardatan closed 10 months ago

ardatan commented 10 months ago

First I'd like to thank you for this great project!

Unfortunately I am having some issues with the latest version v20.36.0.

any('/*') no longer handles all the routes as in previous versions, and the server returns 404;

You can see the reproduction here on CodeSandbox. It has both the previous working version(20.34.0) and the latest version(20.36.0) with unexpected behavior. https://codesandbox.io/p/devbox/uwebsockets-404-5gryd7?file=%2Findex.js%3A7%2C27

uNetworkingAB commented 10 months ago

What if you do App.any("/*", null) before you set it?

uNetworkingAB commented 10 months ago

Yeah you need to remove the default handler by calling App.any("/*", null), this is a mistake it should overwrite it directly, should be fixed but in mean time you can use App.any("/*", null)

uNetworkingAB commented 10 months ago

https://github.com/uNetworking/uWebSockets.js/releases/tag/v20.37.0