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

Remove require('url') in favor of URL #53

Open feross opened 5 years ago

feross commented 5 years ago

(Once we're ready to drop Node 8 support)

For: https://github.com/brave/brave-browser/issues/5490

gillesdemey commented 4 years ago

It doesn't seem viable without support for relative URLs.

Relative URLs are currently used for the redirect logic and parsed from the Location header so we will have to wait for https://github.com/nodejs/node/pull/28482 to land but it requires Node 12.x — which is likely a leap too far.

https://github.com/nodejs/node/issues/12682 https://github.com/whatwg/url/issues/421

feross commented 4 years ago

It's possible to do new URL('...', 'http://example.com') to parse a relative URL.