diff --git a/index.js b/index.js index 2f5bfb0..a3bc784 100644 --- a/index.js +++ b/index.js @@ -126,7 +126,7 @@ function asPromise(opts) { } } - if (statusCode < 200 || statusCode > limitStatusCode) { + if (statusCode !== 304 && (statusCode < 200 || statusCode > limitStatusCode)) { throw new got.HTTPError(statusCode, opts); } @@ -185,7 +185,7 @@ function asStream(opts) { res.pipe(output); - if (statusCode < 200 || statusCode > 299) { + if (statusCode !== 304 && (statusCode < 200 || statusCode > 299)) { proxy.emit('error', new got.HTTPError(statusCode, opts), null, res); return; }