| Summary: | [WinCairo] CloseEvent has wasClean=true and no error code when the WebSocket connection got terminated from the server side | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Max Schmitt <max> | ||||||
| Component: | Platform | Assignee: | Fujii Hironori <Hironori.Fujii> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | aperez, bugs-noreply, don.olmstead, Hironori.Fujii, mcatanzaro, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Other | ||||||||
| OS: | Windows 10 | ||||||||
| Attachments: |
|
||||||||
Looks like this is fixed on Linux now and is only present in Windows. Created attachment 464871 [details]
WIP patch
Created attachment 464879 [details]
server.js
WinCairo WK1 can't load the page because it has no Content-Type responose header. Modified server.js.
I confirmed WinCairo WK1 works fine.
Pull request: https://github.com/WebKit/WebKit/pull/9728 Committed 260025@main (42847605cf96): <https://commits.webkit.org/260025@main> Reviewed commits have been landed. Closing PR #9728 and removing active labels. |
Repro: ```js // server.js const express = require('express'); const ws = require('ws'); const app = express(); const wsServer = new ws.Server({ noServer: true }); app.get("/", (req, res)=>res.end(` <p>watch console</p> <script> function createWs(){ const ws=new WebSocket("ws://localhost:3003/ws"); ws.onopen = e => console.log("onopen", e); ws.onerror = e => console.error("onerror",e); ws.onclose = e => { console.log("onclose",e,e.code,e.wasClean); document.writeln("onclose with code " + e.code + " wasClean: " + e.wasClean); }; } createWs(); </script> `)); const server = app.listen(3003); server.on('upgrade', (request, socket, head) => { wsServer.handleUpgrade(request, socket, head, socket => { socket.terminate(); }); }); ``` 1. `mkdir tmp` 2. `cd tmp` 3. `npm init -y` 4. `npm install ws express` 5. `node server.js` 6. Navigate to `http://localhost:3003` Expected (Firefox, Chromium): `onclose with code 1006 wasClean: false ` Actual (Epiphany 42.1, Custom WebKit on tip-of-tree): `onclose with code 0 wasClean: true` Downstream bug: https://github.com/microsoft/playwright/issues/12353