From e96775980271a10304ecea2207c6b233e1a88057 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 26 Jun 2017 09:34:56 +0300 Subject: [PATCH] Increase max downloaded bytes for link preview twitter.com sends opengraph meta tags within ~20kb of data for individual tweets --- src/plugins/irc-events/link.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/irc-events/link.js b/src/plugins/irc-events/link.js index 86215e58..83cda829 100644 --- a/src/plugins/irc-events/link.js +++ b/src/plugins/irc-events/link.js @@ -123,8 +123,9 @@ function fetch(url, cb) { req .on("response", function(res) { if (!(/^image\/.+/.test(res.headers["content-type"]))) { - // if not image, limit download to 10kb, since we need only meta tags - limit = 1024 * 10; + // if not image, limit download to 50kb, since we need only meta tags + // twitter.com sends opengraph meta tags within ~20kb of data for individual tweets + limit = 1024 * 50; } }) .on("error", function() {})