From 4dfe687a55e39a2e5aa1b6de70dea0c86b89bb31 Mon Sep 17 00:00:00 2001 From: Brian White Date: Tue, 15 Oct 2013 20:10:44 -0400 Subject: [PATCH] Connection: only pass specific text codes to callbacks --- lib/Connection.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Connection.js b/lib/Connection.js index 7136991..e905235 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -33,7 +33,8 @@ var MAX_INT = 9007199254740992, RE_BACKSLASH = /\\/g, RE_DBLQUOTE = /"/g, RE_ESCAPE = /\\\\/g, - RE_INTEGER = /^\d+$/; + RE_INTEGER = /^\d+$/, + RE_PUSH_TEXT_CODES = /^APPENDUID|COPYUID$/i; function Connection(config) { if (!(this instanceof Connection)) @@ -1390,7 +1391,10 @@ Connection.prototype._resTagged = function(info) { }); } else { req.cbargs.unshift(err); - req.cbargs.push(info.textCode); + if (info.textCode + && info.textCode.key + && RE_PUSH_TEXT_CODES.test(info.textCode.key)) + req.cbargs.push(info.textCode); req.cb && req.cb.apply(this, req.cbargs); }