From e7359757b1e0a25e4cadac94347c6fcf8c780c5e Mon Sep 17 00:00:00 2001 From: Vsevolod Strukchinsky Date: Tue, 12 Aug 2014 14:18:14 +0600 Subject: [PATCH] Check that res.statusCode in 200..299 range --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index c45fa96..adb28a2 100644 --- a/index.js +++ b/index.js @@ -42,7 +42,7 @@ module.exports = function (url, opts, cb) { return; } - if (res.statusCode !== 200) { + if (res.statusCode < 200 || res.statusCode > 299) { res.destroy(); cb(res.statusCode); return;