Skip to content

Commit

Permalink
feat: serve msgpack bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
darrachequesne committed Oct 27, 2020
1 parent 64056d6 commit aa7574f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ export class Server extends EventEmitter {

const escapedPath = this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
this.clientPathRegex = new RegExp(
"^" + escapedPath + "/socket\\.io(\\.min)?\\.js(\\.map)?$"
"^" +
escapedPath +
"/socket\\.io(\\.min|\\.msgpack\\.min)?\\.js(\\.map)?$"
);
return this;
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
],
"files": [
"dist/",
"client-dist/",
"wrapper.mjs"
],
"type": "commonjs",
Expand Down
10 changes: 10 additions & 0 deletions test/socket.io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ describe("socket.io", () => {
});
});

it(
"should serve bundle with msgpack parser",
testSource("socket.io.msgpack.min.js")
);

it(
"should serve source map for bundle with msgpack parser",
testSourceMap("socket.io.msgpack.min.js.map")
);

it("should handle 304", done => {
const srv = createServer();
new Server(srv);
Expand Down

0 comments on commit aa7574f

Please sign in to comment.