xmppo / node-xmpp-bosh

An XMPP BOSH & WebSocket server (connection manager) written on node.js using Javascript
https://github.com/xmppo/node-xmpp-bosh
263 stars 85 forks source link

Broken GET handler (JSON data) #13

Closed valeriansaliou closed 12 years ago

valeriansaliou commented 12 years ago

Affects 0.5.X (maybe 0.6) + nodejs 0.4.7

Everything is fine using POST, but with GET:

node.js:134 throw e; // process.nextTick error, or 'error' event on first tick ^ TypeError: Object # has no method 'setHeader' at Object.send_response (/usr/local/lib/node_modules/node-xmpp-bosh/src/response.js:72:19) at Object._send_no_requeue (/usr/local/lib/node_modules/node-xmpp-bosh/src/session.js:855:12) at Object._pop_and_send (/usr/local/lib/node_modules/node-xmpp-bosh/src/session.js:759:18) at Array. (/usr/local/lib/node_modules/node-xmpp-bosh/src/session.js:787:22) at EventEmitter._tickCallback (node.js:126:26) shisp@ubuntu:~$

valeriansaliou commented 12 years ago

./src/response.js:72 -> //this._res.setHeader("Content-Length", Buffer.byteLength(msg, 'utf8')); (commented) makes it work!

dhruvbird commented 12 years ago

Sorry, I seem to have broken this. Fixed on current master - Thanks!