-
Notifications
You must be signed in to change notification settings - Fork 611
Open
Labels
enhancementNew feature or requestNew feature or request
Description
version: v20.51.0
platform: Microsoft Windows NT 10.0.19045.0 x64
calling setYield
breaks default handler
i can assume it is a bug or undocumented behavior
in both cases fix is required
example:
import { App } from "uWebSockets.js";
const app = App();
app.listen(8080, function(token) {
if (!token) console.error(`Failed to start listening`)
})
request to example above results in the following response
> GET / HTTP/1.1
> Host: localhost:8080
> Accept: */*
< HTTP/1.1 404 File Not Found
< Date: Mon, 21 Apr 2025 13:28:41 GMT
< uWebSockets: 20
< Content-Length: 81
with body
<html><body><h1>File Not Found</h1><hr><i>uWebSockets/20 Server</i></body></html>
but when any listener that just yields attached
import { App } from "uWebSockets.js";
const app = App();
app.any("/*", function(res, req) {
console.log(req.getMethod(), req.getUrl());
req.setYield(true);
});
app.listen(8080, function(token) {
if (!token) console.error(`Failed to start listening`)
})
same request fails
> GET / HTTP/1.1
> Host: localhost:8080
> Accept: */*
* Empty reply from server
* Closing connection 60
problem can be solved with attachment of explicit default handler
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request