router
Advanced tools
Comparing version 0.4.1 to 0.4.2
13
index.js
@@ -41,2 +41,5 @@ var http = require('http'); | ||
} | ||
if (that.listeners('request').length) { | ||
return; | ||
} | ||
if (request.method === 'POST' || request.method === 'PUT') { // TODO: check if node doesn't already do this | ||
@@ -55,9 +58,11 @@ request.connection.destroy(); // don't waste bandwidth on data we don't want | ||
server.on('upgrade', function(request, connection, head) { | ||
if (that.listeners('upgrade').length) { | ||
that.emit('upgrade', request, connection, head); | ||
} | ||
that.emit('upgrade', request, connection, head); | ||
if (find(methods.upgrade, request, connection, head)) { | ||
return; | ||
} | ||
connection.destroy(); | ||
if (that.listeners('upgrade').length) { | ||
return; | ||
} | ||
connection.destroy(); | ||
}); | ||
@@ -64,0 +69,0 @@ |
{ | ||
"name":"router", | ||
"version":"0.4.1", | ||
"version":"0.4.2", | ||
"description":"A lean and mean web router", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
7003
148