Skip to content

Commit

Permalink
Don't throw HTTPError on 304 responses
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds committed Dec 20, 2016
1 parent 8859a0f commit 4a3588c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function asPromise(opts) {
}
}

if (statusCode < 200 || statusCode > limitStatusCode) {
if ((statusCode < 200 || statusCode > limitStatusCode) && statusCode !== 304) {
throw new got.HTTPError(statusCode, opts);
}

Expand Down Expand Up @@ -185,7 +185,7 @@ function asStream(opts) {

res.pipe(output);

if (statusCode < 200 || statusCode > 299) {
if ((statusCode < 200 || statusCode > 299) && statusCode !== 304) {
proxy.emit('error', new got.HTTPError(statusCode, opts), null, res);
return;
}
Expand Down

0 comments on commit 4a3588c

Please sign in to comment.