Last active
August 29, 2015 14:10
-
-
Save golyshevd/4783b7d567941eb89861 to your computer and use it in GitHub Desktop.
Yet another node DOS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
http.createServer(function (req, res) { | |
req.on('data', function (c) { | |
console.log('INCOMING DATA %j', c); | |
}); | |
req.on('end', function () { | |
console.log('DONE RECEIVING DATA'); | |
res.end(); | |
}); | |
}).listen(1337); | |
// Пробуем послать неправильный Content-Length | |
// curl -v "http://127.0.0.1:1337/" -d "foo" -H "Content-Length: 5" | |
// Сервер будет таймаутиться и в итоге ваш прокси ответит 504 | |
// Ожидаю увидеть или BadRequest (400) или совсем игнор заголовка Content-Length, | |
// но чтобы все тело докачалось |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment