Skip to content

Commit ef160e5

Browse files
committed
fix 'uWS.HttpResponse writes must be made from within a corked callback.'
1 parent 7b53171 commit ef160e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "uwebsockets-express",
3-
"version": "1.3.12",
3+
"version": "1.3.13",
44
"description": "Express API compatibility layer for uWebSockets.js",
55
"main": "./build/index.js",
66
"module": "./build/index.mjs",

src/ServerResponse.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ export class ServerResponse extends EventEmitter /* implements http.ServerRespon
4545
// write status + headers
4646
this.writeHead(this.statusCode || this.statusCode, this._headers);
4747

48-
// dequeue writes
49-
this._writes.forEach((chunk) => this.res.write(chunk));
50-
5148
// write response
5249
this.res.cork(() => {
50+
// dequeue writes
51+
this._writes.forEach((chunk) => this.res.write(chunk));
52+
5353
this.res.end(body);
5454
});
5555
}

0 commit comments

Comments
 (0)