Skip to content

Commit 461c20f

Browse files
committed
Allow logging of received XML prior to parsing and processing
While trying to debug an inbound request containing invalid xml we realized there was no way to log the raw xml since the xml parser throws an error before the logging function is called
1 parent 92216e2 commit 461c20f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/server.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,13 @@ Server.prototype._requestListener = function(req, res) {
100100
gunzip = null;
101101
}
102102
try {
103+
if (typeof self.log === 'function') {
104+
self.log("received", xml);
105+
}
103106
self._process(xml, req.url, function(result) {
104107
res.write(result);
105108
res.end();
106109
if (typeof self.log === 'function') {
107-
self.log("received", xml);
108110
self.log("replied", result);
109111
}
110112
});

0 commit comments

Comments
 (0)