jacktuck / unfurl

Metadata scraper with support for oEmbed, Twitter Cards and Open Graph Protocol for Node.js :zap:
MIT License
475 stars 51 forks source link

Z_BUF_ERROR makes app crash #34

Closed romainbraun closed 6 years ago

romainbraun commented 6 years ago

When trying to unfurl certain URLs, zlib sometimes throw a Z_BUF_ERROR, and this part of the app makes it crash.

res.body.once('error', (err) => {
      log('error', err.message)

      process.nextTick(function () {
        throw err
      })
    })

I was using this URL https://www.reddit.com/r/holdmybeer/comments/9644ap/work_is_hard/

The result of the unfurling is fine but the app crashes. Should an error really be thrown in the case of that non fatal error?

jacktuck commented 6 years ago

Hi @romainbraun. What version are you using?

romainbraun commented 6 years ago

1.1.7

jacktuck commented 6 years ago

I can replicate very occasionally but seems like i did have some metadata when the error is thrown, so it shouldn't be a fatal error, i'll make a prerelease on npm if you wouldn't mind seeing if it solves the issue in version1.1.8-beta.3

romainbraun commented 6 years ago

Thank you very much for your quick reaction. Giving it a try today!

romainbraun commented 6 years ago

Looking great, I can't seem to be able to reproduce so far.

jacktuck commented 6 years ago

@romainbraun No problem, glad it works for you now 😃

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: