Browse Source

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

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

2
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;

Loading…
Cancel
Save