Skip to content

Commit 64d06b5

Browse files
committed
fix: correctly pass the options when using the Server constructor
1 parent e7115b8 commit 64d06b5

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/engine.io.js

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 0 deletions
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)