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

Method headers

packages/engine.io/lib/transports/polling.ts:383–395  ·  view source on GitHub ↗

* Returns headers for a response. * * @param {http.IncomingMessage} req * @param {Object} headers - extra headers * @private

(req: IncomingMessage, headers: Record<string, string> = {})

Source from the content-addressed store, hash-verified

381 * @private
382 */
383 private headers(req: IncomingMessage, headers: Record<string, string> = {}) {
384 // prevent XSS warnings on IE
385 // https://github.com/LearnBoost/socket.io/pull/1333
386 const ua = req.headers["user-agent"];
387 if (ua && (~ua.indexOf(";MSIE") || ~ua.indexOf("Trident/"))) {
388 headers["X-XSS-Protection"] = "0";
389 }
390
391 headers["cache-control"] = "no-store";
392
393 this.emit("headers", headers, req);
394 return headers;
395 }
396}

Callers 2

onEndMethod · 0.95
respondMethod · 0.95

Calls 1

emitMethod · 0.65

Tested by

no test coverage detected