From 703b2e7bb3576b50715ccd642e6a371610272372 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Wed, 21 Dec 2016 14:50:56 +0700 Subject: [PATCH] Make sure got doesn't throw 304s --- src/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/index.js b/src/index.js index 475b26e..7b7be9d 100644 --- a/src/index.js +++ b/src/index.js @@ -109,6 +109,14 @@ class Onionoo { }, options) return got(url, options) + .catch(error => { + // Don't throw 304 responses + if (error.statusCode === 304) { + return error.response + } else { + throw error + } + }) .then(response => { // Format response response = {