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

Function testForHeaders

packages/engine.io/test/server.js:3506–3520  ·  view source on GitHub ↗
(headers, callback)

Source from the content-addressed store, hash-verified

3504
3505 describe("response headers", () => {
3506 function testForHeaders(headers, callback) {
3507 const engine = listen((port) => {
3508 engine.on("connection", (conn) => {
3509 conn.transport.once("headers", (headers) => {
3510 callback(headers);
3511 conn.close();
3512 });
3513 conn.send("hi");
3514 });
3515 new ClientSocket(`ws://localhost:${port}`, {
3516 extraHeaders: headers,
3517 transports: ["polling"],
3518 });
3519 });
3520 }
3521
3522 it("should contain X-XSS-Protection: 0 for IE8", (done) => {
3523 const headers = {

Callers 1

server.jsFile · 0.85

Calls 5

listenFunction · 0.85
callbackFunction · 0.50
onMethod · 0.45
closeMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…