-
Notifications
You must be signed in to change notification settings - Fork 301
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
h3: 2.0.1-rc.5
Reproduction
https://h3.dev/guide/advanced/websocket
Describe the bug
Here is the app.fetch's type
Line 106 in d6475e1
| fetch(_request: ServerRequest): Response | Promise<Response>; |
fetch(_request: ServerRequest): Response | Promise<Response>; But when we use defineWebsocketHandler, the function returns crossws as an extra result
https://github.com/h3js/h3/blob/d6475e131b3a80f44bebd5b95ce3e106ed1ac258/src/utils/ws.ts#L23C1-L41C2
/**
* Define WebSocket event handler.
*
* @see https://h3.dev/guide/websocket
*/
export function defineWebSocketHandler(
hooks: Partial<WebSocketHooks>,
): EventHandler {
return defineHandler(function _webSocketHandler() {
return Object.assign(
new Response("WebSocket upgrade is required.", {
status: 426,
}),
{
crossws: hooks,
},
);
});
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working