diff options
Diffstat (limited to 'news')
-rw-r--r-- | news/newsbot.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/news/newsbot.js b/news/newsbot.js index 73a6111b..683bf39a 100644 --- a/news/newsbot.js +++ b/news/newsbot.js @@ -105,6 +105,17 @@ function create_feedbot (nick, uri, channels) { if (response.statusCode !== 200) { return this.emit('error', new Error('Bad status code')) } + var output = res + switch (res.headers['content-encoding']) { + case 'gzip': + output = zlib.createGunzip() + res.pipe(output) + break + case 'deflate': + output = zlib.createInflate() + res.pipe(output) + break + } this.pipe(feedparser) }) |