Skip to content

Commit

Permalink
fix: correctly pass the options when using the Server constructor (#610)
Browse files Browse the repository at this point in the history
Fixes #580
  • Loading branch information
2Pacalypse- committed Dec 30, 2020
1 parent 04ea358 commit cec2750
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/engine.io.js
Expand Up @@ -26,7 +26,7 @@ exports = module.exports = function() {
}

// if first argument is not an http server, then just make a regular eio server
return new Server(arguments);
return new Server(...arguments);
};

/**
Expand Down
5 changes: 5 additions & 0 deletions test/engine.io.js
Expand Up @@ -25,6 +25,11 @@ describe("engine", () => {
expect(engine).to.be.an(eio.Server);
expect(engine.ws).to.be.ok();
});

it("should pass options correctly to the Server", () => {
const engine = eio({ cors: true });
expect(engine.opts).to.have.property("cors", true);
});
});

describe("listen", () => {
Expand Down

0 comments on commit cec2750

Please sign in to comment.