Browse Source

Make sure got doesn't throw 304s

pull/15/head
Luke Childs 8 years ago
parent
commit
703b2e7bb3
  1. 8
      src/index.js

8
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 = {

Loading…
Cancel
Save