From 6ed81dbf3b544200f7a644f039cc36c8004eb863 Mon Sep 17 00:00:00 2001 From: Mark Frost Date: Fri, 26 Mar 2021 12:49:55 +0000 Subject: [PATCH 1/2] Don't attempt to install probe for socket.io v3 or v4 --- probes/socketio-probe.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/probes/socketio-probe.js b/probes/socketio-probe.js index da27ada1..f135b22a 100644 --- a/probes/socketio-probe.js +++ b/probes/socketio-probe.js @@ -28,6 +28,16 @@ util.inherits(SocketioProbe, Probe); SocketioProbe.prototype.attach = function(name, target) { var that = this; if (name != 'socket.io') return target; + + /* + * socket.io v2 directly exports the function to be patched + * socket.io v3 & v4 exports a factory function, with a Class as .Server which can't be patched successfully by the code below + */ + if (target.Server) { + // don't attempt to patch v3+ + return target; + } + /* * Don't set __ddProbeAttached__ = true as we need to probe and return * the constructor each time From c9752279e3cb405a1e472366690b74fe20a45b99 Mon Sep 17 00:00:00 2001 From: Mark Frost Date: Fri, 26 Mar 2021 12:55:07 +0000 Subject: [PATCH 2/2] add frostmar --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 842dc17a..9305d3ef 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -23,3 +23,4 @@ Authors ordered by first contribution: - Richard Waller (https://github.com/rwalle61) - Russell Howe (https://github.com/rhowe-gds) - Gaby Baghdadi (https://github.com/gabylb) + - Mark Frost (https://github.com/frostmar)