feross / simple-get

Simplest way to make http get requests. Supports HTTPS, redirects, gzip/deflate, streams in < 100 lines
MIT License
401 stars 50 forks source link

Node.js v19 Breaking Change #80

Open RafaelGSS opened 1 year ago

RafaelGSS commented 1 year ago

Hello!

I'm opening this PR just to inform the new Node.js release v19 might break a few users that expect the connection will be closed after the first request.

Example:

sget({
        method: 'POST',
        url: 'localhost:3000',
      }, (err, res, body) => {
        ...
      })

sget({
        method: 'POST',
        url: 'localhost:3000',
        agent: false, // this will obligate creating an agent for every request, so the connection won't be reutilized by default
      }, (err, res, body) => {
        ...
      })
JulienBrgs commented 9 months ago

I confirm this cause problem with node 20.x in my case