(core) Update WS deps after grist-core sync

Summary:
Some WS-related code was touched in a recent PR to grist-core. This extends
those changes to the rest of the codebase so that builds work again.

Test Plan: N/A

Reviewers: dsagal

Reviewed By: dsagal

Subscribers: dsagal

Differential Revision: https://phab.getgrist.com/D4224
This commit is contained in:
George Gevoian
2024-04-02 22:24:50 -07:00
parent b505d21e79
commit c87d835533
4 changed files with 31 additions and 14 deletions

View File

@@ -108,4 +108,4 @@ export class GristSocketServer {
(socket as any).request = null; // Free initial request as recommended in the Engine.IO documentation
this._connectionHandler?.(new GristServerSocketEIO(socket), req);
}
}
}

View File

@@ -350,7 +350,7 @@ export function getEndUserProtocol(req: IncomingMessage) {
}
// TODO we shouldn't blindly trust X-Forwarded-Proto. See the Express approach:
// https://expressjs.com/en/5x/api.html#trust.proxy.options.table
return req.headers["x-forwarded-proto"] || ((req.socket as TLSSocket).encrypted ? 'https' : 'http');
return req.headers["x-forwarded-proto"] || ((req.socket as TLSSocket)?.encrypted ? 'https' : 'http');
}
/**