feat: serve msgpack bundle

See 71d60480af
This commit is contained in:
Damien Arrachequesne
2020-10-27 23:17:12 +01:00
parent 64056d6616
commit aa7574f884
3 changed files with 14 additions and 1 deletions

View File

@@ -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;
}

View File

@@ -13,6 +13,7 @@
],
"files": [
"dist/",
"client-dist/",
"wrapper.mjs"
],
"type": "commonjs",

View File

@@ -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);