Skip to content

Commit aa7574f

Browse files
committedOct 27, 2020
feat: serve msgpack bundle
See socketio/socket.io-client@71d6048
1 parent 64056d6 commit aa7574f

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed
 

‎lib/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,9 @@ export class Server extends EventEmitter {
272272

273273
const escapedPath = this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
274274
this.clientPathRegex = new RegExp(
275-
"^" + escapedPath + "/socket\\.io(\\.min)?\\.js(\\.map)?$"
275+
"^" +
276+
escapedPath +
277+
"/socket\\.io(\\.min|\\.msgpack\\.min)?\\.js(\\.map)?$"
276278
);
277279
return this;
278280
}

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
],
1414
"files": [
1515
"dist/",
16+
"client-dist/",
1617
"wrapper.mjs"
1718
],
1819
"type": "commonjs",

‎test/socket.io.ts

+10
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,16 @@ describe("socket.io", () => {
9292
});
9393
});
9494

95+
it(
96+
"should serve bundle with msgpack parser",
97+
testSource("socket.io.msgpack.min.js")
98+
);
99+
100+
it(
101+
"should serve source map for bundle with msgpack parser",
102+
testSourceMap("socket.io.msgpack.min.js.map")
103+
);
104+
95105
it("should handle 304", done => {
96106
const srv = createServer();
97107
new Server(srv);

0 commit comments

Comments
 (0)
Please sign in to comment.