Increase max downloaded bytes for link preview
twitter.com sends opengraph meta tags within ~20kb of data for individual tweets
This commit is contained in:
parent
cfd71cab02
commit
e967759802
@ -123,8 +123,9 @@ function fetch(url, cb) {
|
|||||||
req
|
req
|
||||||
.on("response", function(res) {
|
.on("response", function(res) {
|
||||||
if (!(/^image\/.+/.test(res.headers["content-type"]))) {
|
if (!(/^image\/.+/.test(res.headers["content-type"]))) {
|
||||||
// if not image, limit download to 10kb, since we need only meta tags
|
// if not image, limit download to 50kb, since we need only meta tags
|
||||||
limit = 1024 * 10;
|
// twitter.com sends opengraph meta tags within ~20kb of data for individual tweets
|
||||||
|
limit = 1024 * 50;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on("error", function() {})
|
.on("error", function() {})
|
||||||
|
Loading…
Reference in New Issue
Block a user