mirror of
https://github.com/postlight/mercury-parser
synced 2024-11-17 03:25:31 +00:00
fix: encoding request response as null
This fixes an issue with gzipped content
This commit is contained in:
parent
ddc684c7d3
commit
dfb5334f18
@ -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)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -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)
|
||||||
|
@ -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')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user