Skip to content

Commit cec2750

Browse files
authored
fix: correctly pass the options when using the Server constructor (#610)
Fixes #580
1 parent 04ea358 commit cec2750

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/engine.io.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ exports = module.exports = function() {
2626
}
2727

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

3232
/**

test/engine.io.js

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ describe("engine", () => {
2525
expect(engine).to.be.an(eio.Server);
2626
expect(engine.ws).to.be.ok();
2727
});
28+
29+
it("should pass options correctly to the Server", () => {
30+
const engine = eio({ cors: true });
31+
expect(engine.opts).to.have.property("cors", true);
32+
});
2833
});
2934

3035
describe("listen", () => {

0 commit comments

Comments
 (0)