fix: encoding request response as null

This fixes an issue with gzipped content
This commit is contained in:
Adam Pash 2016-09-07 13:29:11 -04:00
parent ddc684c7d3
commit dfb5334f18
3 changed files with 3 additions and 2 deletions

View File

@ -26,7 +26,7 @@ describe('extractCleanNode(article, $, { cleanConditionally })', () => {
// console.log(result) // console.log(result)
// console.log(bestNode.html()) // console.log(bestNode.html())
assert.equal($(bestNode).text().length, 3652) assert.equal($(bestNode).text().length, 2687)
}) })
}) })

View File

@ -23,6 +23,7 @@ export default async function fetchResource(url) {
url: parsedUrl, url: parsedUrl,
headers: REQUEST_HEADERS, headers: REQUEST_HEADERS,
timeout: FETCH_TIMEOUT, timeout: FETCH_TIMEOUT,
encoding: null,
} }
const { response, body } = await get(options) const { response, body } = await get(options)

View File

@ -13,7 +13,7 @@ describe('fetchResource(url)', () => {
const url = 'http://theconcourse.deadspin.com/1786177057' const url = 'http://theconcourse.deadspin.com/1786177057'
const { body, response } = await fetchResource(url) const { body, response } = await fetchResource(url)
assert.equal(typeof body, 'string') assert.equal(typeof body, 'object')
}) })
}) })