MCPcopy
hub / github.com/socketio/socket.io / onEnd

Method onEnd

packages/engine.io/lib/transports/polling.ts:162–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

160 };
161
162 const onEnd = () => {
163 this.onData(chunks);
164
165 const headers = {
166 // text/html is required instead of text/plain to avoid an
167 // unwanted download dialog on certain user-agents (GH-43)
168 "Content-Type": "text/html",
169 "Content-Length": "2",
170 };
171
172 res.writeHead(200, this.headers(req, headers));
173 res.end("ok");
174 cleanup();
175 };
176
177 req.on("close", onClose);
178 if (!isBinary) req.setEncoding("utf8");

Callers

nothing calls this directly

Calls 5

onDataMethod · 0.95
headersMethod · 0.95
cleanupFunction · 0.85
writeHeadMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected