Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fixed some typos; jsonp sets content-type:
  • Loading branch information
dvv committed Jun 2, 2011
commit 8c3b7d99c2e9a698c73e64b432e6a51b58194611
6 changes: 3 additions & 3 deletions lib/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Manager.prototype.handleRequest = function (req, res) {
this.log.debug('ignoring request outside socket.io namespace');

for (var i = 0, l = this.oldListeners.length; i < l; i++)
this.oldListeners[i].call(this, req, res);
this.oldListeners[i].call(this.server, req, res);

return;
}
Expand Down Expand Up @@ -441,9 +441,9 @@ Manager.prototype.handleHandshake = function (data, req, res) {
].join(':');

if (data.query.jsonp)
hs = 'io[' + data.query.jsonp + '](' + JSON.stringify(hs) + ');';
hs = 'io.j[' + data.query.jsonp + '](' + JSON.stringify(hs) + ');';

res.writeHead(200);
res.writeHead(200, {'content-type': 'application/javascript'});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Content-Type is preferred here
  • You're sending application/json for all handshakes, not just JSONP.

res.end(hs);
});
} else {
Expand Down