MCPcopy Index your code
hub / github.com/github/docs / isConnectionDropped

Function isConnectionDropped

middleware/halt-on-dropped-connection.js:1–6  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

1export function isConnectionDropped(req, res) {
2 // Have the flags been set for:
3 // - a global request timeout (via the express-timeout-handler middleware)?
4 // - an aborted request connection (via Node.js core's HTTP IncomingMessage)?
5 return Boolean(res.globalTimeout || req.aborted)
6}
7
8export function haltOnDroppedConnection(req, res, next) {
9 // Only proceed if the flag has not been set for the express-timeout-handler middleware

Callers 2

renderPageFunction · 0.90
haltOnDroppedConnectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected