Skip to content

Commit

Permalink
refactor: remove useless reference
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Nov 9, 2023
1 parent 2da559a commit 1e126b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/transports-uws/polling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export class Polling extends Transport {
*/
onRequest(req) {
const res = req.res;
// remove the reference to the ServerResponse object (as the first request of the session is kept in memory by default)
req.res = null;

if (req.getMethod() === "get") {
this.onPollRequest(req, res);
Expand Down
2 changes: 2 additions & 0 deletions lib/transports/polling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export class Polling extends Transport {
*/
onRequest(req: IncomingMessage & { res: ServerResponse }) {
const res = req.res;
// remove the reference to the ServerResponse object (as the first request of the session is kept in memory by default)
req.res = null;

if ("GET" === req.method) {
this.onPollRequest(req, res);
Expand Down

0 comments on commit 1e126b6

Please sign in to comment.