Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Commit

Permalink
Use the entire HTTP status 3xx range for redirect detection
Browse files Browse the repository at this point in the history
  • Loading branch information
joelpurra committed Aug 27, 2014
1 parent c661b57 commit d0a3609
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/get/netsniff.js
Expand Up @@ -18,7 +18,9 @@ if (!Date.prototype.toISOString) {
}

function isRedirect(reply) {
return [301, 302].indexOf(reply.status) >= 0;
var isInRange = reply && typeof reply.status == "number" && reply.status >= 300 && reply.status <= 399;

return isInRange
}

function getHeaderValue(reply, name) {
Expand Down

0 comments on commit d0a3609

Please sign in to comment.