ladjs / superagent

Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
https://ladjs.github.io/superagent/
MIT License
16.58k stars 1.33k forks source link

"double callback bug" is logged when http2 error occur #1598

Open asomethings opened 3 years ago

asomethings commented 3 years ago

If I request an non-http2 server with http2 superagent throws error with superagent: double callback bug. Wondering if this is an expected behavior for http2?

Sample code

superagent
  .get('https://github.com')
  .http2()
  .then(console.log)
  .catch(console.log)