Skip to content

Commit 911d0e3

Browse files
refactor: return HTTP 400 upon invalid request overlap
In both cases, the error comes from the client as it should not send multiple concurrent requests, so a HTTP 4xx code is mandated. Related: #650
1 parent bd6d471 commit 911d0e3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/transports/polling.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ export class Polling extends Transport {
7575
debug("request overlap");
7676
// assert: this.res, '.req and .res should be (un)set together'
7777
this.onError("overlap from client");
78-
// TODO for the next major release: use an HTTP 400 status code (https://github.com/socketio/engine.io/issues/650)
79-
res.writeHead(500);
78+
res.writeHead(400);
8079
res.end();
8180
return;
8281
}
@@ -117,8 +116,7 @@ export class Polling extends Transport {
117116
if (this.dataReq) {
118117
// assert: this.dataRes, '.dataReq and .dataRes should be (un)set together'
119118
this.onError("data request overlap from client");
120-
// TODO for the next major release: use an HTTP 400 status code (https://github.com/socketio/engine.io/issues/650)
121-
res.writeHead(500);
119+
res.writeHead(400);
122120
res.end();
123121
return;
124122
}

0 commit comments

Comments
 (0)