Browse Source

Merge pull request #3 from floatdrop/check-for-2xx-codes

Check that res.statusCode in 200..299 range
http2
Sindre Sorhus 11 years ago
parent
commit
745b1b9e41
  1. 2
      index.js

2
index.js

@ -42,7 +42,7 @@ module.exports = function (url, opts, cb) {
return; return;
} }
if (res.statusCode !== 200) { if (res.statusCode < 200 || res.statusCode > 299) {
res.destroy(); res.destroy();
cb(res.statusCode); cb(res.statusCode);
return; return;

Loading…
Cancel
Save