Skip to content

Commit

Permalink
refactor: return HTTP 409 upon invalid request overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed May 1, 2023
1 parent 7033c0e commit 4d0d4ac
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/transports/polling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ export class Polling extends Transport {
debug("request overlap");
// assert: this.res, '.req and .res should be (un)set together'
this.onError("overlap from client");
// TODO for the next major release: use an HTTP 400 status code (https://github.com/socketio/engine.io/issues/650)
res.writeHead(500);
res.writeHead(409);
res.end();
return;
}
Expand Down Expand Up @@ -117,8 +116,7 @@ export class Polling extends Transport {
if (this.dataReq) {
// assert: this.dataRes, '.dataReq and .dataRes should be (un)set together'
this.onError("data request overlap from client");
// TODO for the next major release: use an HTTP 400 status code (https://github.com/socketio/engine.io/issues/650)
res.writeHead(500);
res.writeHead(409);
res.end();
return;
}
Expand Down

0 comments on commit 4d0d4ac

Please sign in to comment.